From a0ad1f2ad46507f13a16d342b9ccf35a38bae3d5 Mon Sep 17 00:00:00 2001 From: Paul Holzinger Date: Fri, 11 Mar 2022 16:10:32 +0100 Subject: remove unneeded k8s code There is a lot of unneeded code, k8s is the by far the biggest dependency in podman. We should remove as much as possible so that we only have the stuff left that we use. This is just a quick skim over the code which removes a lot of the generated code and many packages that are now unused. I know that this will be impossible to properly review. I will try to make smaller changes in follow up work. Right now this reduces about 8 MB in binary size!!! [NO NEW TESTS NEEDED] Hopefully existing tests will catch any problems. Signed-off-by: Paul Holzinger --- pkg/domain/infra/abi/play.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'pkg/domain') diff --git a/pkg/domain/infra/abi/play.go b/pkg/domain/infra/abi/play.go index 0a9a0d04b..e16da4ed9 100644 --- a/pkg/domain/infra/abi/play.go +++ b/pkg/domain/infra/abi/play.go @@ -588,7 +588,7 @@ func (ic *ContainerEngine) playKubePVC(ctx context.Context, pvcYAML *v1.Persiste // Get pvc name. // This is the only required pvc attribute to create a podman volume. - name := pvcYAML.GetName() + name := pvcYAML.Name if strings.TrimSpace(name) == "" { return nil, fmt.Errorf("persistent volume claim name can not be empty") } @@ -596,13 +596,13 @@ func (ic *ContainerEngine) playKubePVC(ctx context.Context, pvcYAML *v1.Persiste // Create podman volume options. volOptions := []libpod.VolumeCreateOption{ libpod.WithVolumeName(name), - libpod.WithVolumeLabels(pvcYAML.GetLabels()), + libpod.WithVolumeLabels(pvcYAML.Labels), } // Get pvc annotations and create remaining podman volume options if available. // These are podman volume options that do not match any of the persistent volume claim // attributes, so they can be configured using annotations since they will not affect k8s. - for k, v := range pvcYAML.GetAnnotations() { + for k, v := range pvcYAML.Annotations { switch k { case util.VolumeDriverAnnotation: volOptions = append(volOptions, libpod.WithVolumeDriver(v)) -- cgit v1.2.3-54-g00ecf