From 55b077ab0423fe50871d225f53be99c386a59c6a Mon Sep 17 00:00:00 2001 From: Charlie Drage Date: Sun, 2 Jun 2024 14:46:57 -0400 Subject: [PATCH] cleanup: removes uneeded annotation when not using network policy (#1884) #### What type of PR is this? /kind cleanup #### What this PR does / why we need it: Removes the network policy annotation which is not needed (we are not generating network policy) #### Which issue(s) this PR fixes: Fixes https://github.com/kubernetes/kompose/issues/1759 #### Special notes for your reviewer: --- pkg/transformer/kubernetes/k8sutils.go | 19 ++++++++++++++++--- pkg/transformer/kubernetes/kubernetes.go | 2 +- pkg/transformer/kubernetes/kubernetes_test.go | 1 - .../output-k8s-empty-vols-template.yaml | 2 -- .../fixtures/change-in-volume/output-k8s.yaml | 2 -- .../output-os-empty-vols-template.yaml | 2 -- .../fixtures/change-in-volume/output-os.yaml | 2 -- .../compose-env-interpolation/output-k8s.yaml | 1 - .../compose-file-env-variable/output-k8s.yaml | 2 -- .../compose-file-support/output-k8s.yaml | 1 - .../configmap-file-configs/output-k8s-1.yaml | 1 - .../configmap-file-configs/output-k8s-2.yaml | 1 - .../configmap-file-configs/output-k8s-3.yaml | 1 - .../configmap-file-configs/output-os-1.yaml | 1 - .../configmap-file-configs/output-os-2.yaml | 1 - .../configmap-file-configs/output-os-3.yaml | 1 - .../fixtures/configmap-pod/output-k8s.yaml | 1 - .../fixtures/configmap-pod/output-os.yaml | 1 - .../output-k8s-withlabel.yaml | 2 -- .../fixtures/configmap-volume/output-k8s.yaml | 2 -- .../configmap-volume/output-os-withlabel.yaml | 2 -- .../fixtures/configmap-volume/output-os.yaml | 2 -- script/test/fixtures/cronjob/output-k8s.yaml | 1 - script/test/fixtures/cronjob/output-os.yaml | 1 - .../placement/output-placement-k8s.yaml | 1 - .../deploy/placement/output-placement-os.yaml | 1 - .../fixtures/env-multiple/output-k8s.yaml | 2 -- .../test/fixtures/env-multiple/output-os.yaml | 2 -- script/test/fixtures/env/output-k8s.yaml | 2 -- script/test/fixtures/env/output-os.yaml | 2 -- .../envvars-interpolation/output-k8s.yaml | 1 - .../envvars-interpolation/output-os.yaml | 1 - .../envvars-with-status/output-k8s.yaml | 1 - .../envvars-with-status/output-os.yaml | 1 - script/test/fixtures/expose/output-k8s.yaml | 2 -- script/test/fixtures/expose/output-os.yaml | 2 -- .../output-k8s-v1.yaml | 1 - .../output-k8s-v2.yaml | 1 - .../external-traffic-policy/output-os-v1.yaml | 1 - .../external-traffic-policy/output-os-v2.yaml | 1 - script/test/fixtures/fsgroup/output-k8s.yaml | 1 - script/test/fixtures/fsgroup/output-os.yaml | 1 - .../healthcheck/output-healthcheck-k8s.yaml | 4 ---- .../healthcheck/output-healthcheck-os.yaml | 4 ---- .../host-port-protocol/output-k8s.yaml | 1 - .../host-port-protocol/output-os.yaml | 1 - script/test/fixtures/hpa/output-k8s.yaml | 1 - .../fixtures/initcontainer/output-k8s.yaml | 1 - .../fixtures/multiple-files/output-k8s.yaml | 2 -- .../fixtures/multiple-files/output-os.yaml | 2 -- .../multiple-type-volumes/output-k8s.yaml | 2 -- .../multiple-type-volumes/output-os.yaml | 2 -- .../test/fixtures/namespace/output-k8s.yaml | 1 - script/test/fixtures/namespace/output-os.yaml | 1 - .../network-mode-service/output-k8s.yaml | 1 - .../test/fixtures/read-only/output-k8s.yaml | 1 - script/test/fixtures/read-only/output-os.yaml | 1 - .../resources-lowercase/output-k8s.yaml | 1 - .../resources-lowercase/output-os.yaml | 1 - .../fixtures/service-group/output-k8s.yaml | 1 - .../single-file-output/output-k8s.yaml | 1 - .../test/fixtures/statefulset/output-k8s.yaml | 2 -- .../test/fixtures/statefulset/output-os.yaml | 4 ---- script/test/fixtures/v2/output-k8s.yaml | 2 -- script/test/fixtures/v2/output-os.yaml | 2 -- script/test/fixtures/v3.0/output-k8s.yaml | 4 ---- script/test/fixtures/v3.0/output-os.yaml | 4 ---- .../fixtures/vols-subpath/output-k8s.yaml | 1 - .../test/fixtures/vols-subpath/output-os.yaml | 1 - .../volume-mounts/windows/output-k8s.yaml | 1 - .../volume-mounts/windows/output-os.yaml | 1 - 71 files changed, 17 insertions(+), 110 deletions(-) diff --git a/pkg/transformer/kubernetes/k8sutils.go b/pkg/transformer/kubernetes/k8sutils.go index adf83f06e..76eb214bb 100644 --- a/pkg/transformer/kubernetes/k8sutils.go +++ b/pkg/transformer/kubernetes/k8sutils.go @@ -503,13 +503,20 @@ func (k *Kubernetes) CreateHeadlessService(name string, service kobject.ServiceC } // UpdateKubernetesObjectsMultipleContainers method updates the kubernetes objects with the necessary data -func (k *Kubernetes) UpdateKubernetesObjectsMultipleContainers(name string, service kobject.ServiceConfig, objects *[]runtime.Object, podSpec PodSpec) error { +func (k *Kubernetes) UpdateKubernetesObjectsMultipleContainers(name string, service kobject.ServiceConfig, objects *[]runtime.Object, podSpec PodSpec, opt kobject.ConvertOptions) error { // Configure annotations annotations := transformer.ConfigAnnotations(service) // fillTemplate fills the pod template with the value calculated from config fillTemplate := func(template *api.PodTemplateSpec) error { - template.ObjectMeta.Labels = transformer.ConfigLabelsWithNetwork(name, service.Network) + + // We will ONLY add config labels with network if we actually + // passed in --generate-network-policies to the kompose command + if opt.GenerateNetworkPolicies { + template.ObjectMeta.Labels = transformer.ConfigLabelsWithNetwork(name, service.Network) + } else { + template.ObjectMeta.Labels = transformer.ConfigLabels(name) + } template.Spec = podSpec.Get() return nil } @@ -660,7 +667,13 @@ func (k *Kubernetes) UpdateKubernetesObjects(name string, service kobject.Servic template.Spec.SecurityContext = podSecurityContext } template.Spec.Containers[0].Ports = ports - template.ObjectMeta.Labels = transformer.ConfigLabelsWithNetwork(name, service.Network) + + // Only add network mode if generate-network-policies is set + if opt.GenerateNetworkPolicies { + template.ObjectMeta.Labels = transformer.ConfigLabelsWithNetwork(name, service.Network) + } else { + template.ObjectMeta.Labels = transformer.ConfigLabels(name) + } // Configure the image pull policy policy, err := GetImagePullPolicy(name, service.ImagePullPolicy) diff --git a/pkg/transformer/kubernetes/kubernetes.go b/pkg/transformer/kubernetes/kubernetes.go index 4e1480e1b..72881833b 100644 --- a/pkg/transformer/kubernetes/kubernetes.go +++ b/pkg/transformer/kubernetes/kubernetes.go @@ -1600,7 +1600,7 @@ func (k *Kubernetes) Transform(komposeObject kobject.KomposeObject, opt kobject. podSpec.Append(ServiceAccountName(serviceAccountName)) } - err = k.UpdateKubernetesObjectsMultipleContainers(groupName, service, &objects, podSpec) + err = k.UpdateKubernetesObjectsMultipleContainers(groupName, service, &objects, podSpec, opt) if err != nil { return nil, errors.Wrap(err, "Error transforming Kubernetes objects") } diff --git a/pkg/transformer/kubernetes/kubernetes_test.go b/pkg/transformer/kubernetes/kubernetes_test.go index 3bf174979..e252073c6 100644 --- a/pkg/transformer/kubernetes/kubernetes_test.go +++ b/pkg/transformer/kubernetes/kubernetes_test.go @@ -50,7 +50,6 @@ func newServiceConfig() kobject.ServiceConfig { WorkingDir: "dir", Args: []string{"arg1", "arg2"}, VolList: []string{"/tmp/volume"}, - Network: []string{"network1", "network2"}, // supported Labels: nil, FsGroup: 1001, Annotations: map[string]string{"abc": "def"}, diff --git a/script/test/fixtures/change-in-volume/output-k8s-empty-vols-template.yaml b/script/test/fixtures/change-in-volume/output-k8s-empty-vols-template.yaml index f8b0cfea0..7c0fde2ba 100644 --- a/script/test/fixtures/change-in-volume/output-k8s-empty-vols-template.yaml +++ b/script/test/fixtures/change-in-volume/output-k8s-empty-vols-template.yaml @@ -44,7 +44,6 @@ spec: template: metadata: labels: - io.kompose.network/change-in-volume-default: "true" io.kompose.service: redis spec: containers: @@ -69,7 +68,6 @@ spec: template: metadata: labels: - io.kompose.network/change-in-volume-default: "true" io.kompose.service: web spec: containers: diff --git a/script/test/fixtures/change-in-volume/output-k8s.yaml b/script/test/fixtures/change-in-volume/output-k8s.yaml index f8b0cfea0..7c0fde2ba 100644 --- a/script/test/fixtures/change-in-volume/output-k8s.yaml +++ b/script/test/fixtures/change-in-volume/output-k8s.yaml @@ -44,7 +44,6 @@ spec: template: metadata: labels: - io.kompose.network/change-in-volume-default: "true" io.kompose.service: redis spec: containers: @@ -69,7 +68,6 @@ spec: template: metadata: labels: - io.kompose.network/change-in-volume-default: "true" io.kompose.service: web spec: containers: diff --git a/script/test/fixtures/change-in-volume/output-os-empty-vols-template.yaml b/script/test/fixtures/change-in-volume/output-os-empty-vols-template.yaml index f8f2ad620..054984f1c 100644 --- a/script/test/fixtures/change-in-volume/output-os-empty-vols-template.yaml +++ b/script/test/fixtures/change-in-volume/output-os-empty-vols-template.yaml @@ -43,7 +43,6 @@ spec: template: metadata: labels: - io.kompose.network/change-in-volume-default: "true" io.kompose.service: redis spec: containers: @@ -96,7 +95,6 @@ spec: template: metadata: labels: - io.kompose.network/change-in-volume-default: "true" io.kompose.service: web spec: containers: diff --git a/script/test/fixtures/change-in-volume/output-os.yaml b/script/test/fixtures/change-in-volume/output-os.yaml index f8f2ad620..054984f1c 100644 --- a/script/test/fixtures/change-in-volume/output-os.yaml +++ b/script/test/fixtures/change-in-volume/output-os.yaml @@ -43,7 +43,6 @@ spec: template: metadata: labels: - io.kompose.network/change-in-volume-default: "true" io.kompose.service: redis spec: containers: @@ -96,7 +95,6 @@ spec: template: metadata: labels: - io.kompose.network/change-in-volume-default: "true" io.kompose.service: web spec: containers: diff --git a/script/test/fixtures/compose-env-interpolation/output-k8s.yaml b/script/test/fixtures/compose-env-interpolation/output-k8s.yaml index e86ee0458..6e2f2b3f0 100644 --- a/script/test/fixtures/compose-env-interpolation/output-k8s.yaml +++ b/script/test/fixtures/compose-env-interpolation/output-k8s.yaml @@ -28,7 +28,6 @@ spec: template: metadata: labels: - io.kompose.network/compose-env-interpolation-default: "true" io.kompose.service: foo spec: containers: diff --git a/script/test/fixtures/compose-file-env-variable/output-k8s.yaml b/script/test/fixtures/compose-file-env-variable/output-k8s.yaml index d0e3d0bca..266f44bf0 100644 --- a/script/test/fixtures/compose-file-env-variable/output-k8s.yaml +++ b/script/test/fixtures/compose-file-env-variable/output-k8s.yaml @@ -43,7 +43,6 @@ spec: template: metadata: labels: - io.kompose.network/compose-file-env-variable-default: "true" io.kompose.service: alpine spec: containers: @@ -69,7 +68,6 @@ spec: template: metadata: labels: - io.kompose.network/compose-file-env-variable-default: "true" io.kompose.service: debian spec: containers: diff --git a/script/test/fixtures/compose-file-support/output-k8s.yaml b/script/test/fixtures/compose-file-support/output-k8s.yaml index 065b13f91..4b2572950 100644 --- a/script/test/fixtures/compose-file-support/output-k8s.yaml +++ b/script/test/fixtures/compose-file-support/output-k8s.yaml @@ -29,7 +29,6 @@ spec: template: metadata: labels: - io.kompose.network/compose-file-support-default: "true" io.kompose.service: web spec: containers: diff --git a/script/test/fixtures/configmap-file-configs/output-k8s-1.yaml b/script/test/fixtures/configmap-file-configs/output-k8s-1.yaml index caa97befb..bcd817ca3 100644 --- a/script/test/fixtures/configmap-file-configs/output-k8s-1.yaml +++ b/script/test/fixtures/configmap-file-configs/output-k8s-1.yaml @@ -33,7 +33,6 @@ spec: template: metadata: labels: - io.kompose.network/configmap-file-configs-default: "true" io.kompose.service: busy spec: containers: diff --git a/script/test/fixtures/configmap-file-configs/output-k8s-2.yaml b/script/test/fixtures/configmap-file-configs/output-k8s-2.yaml index 3e0b5af7a..dc4a40e81 100644 --- a/script/test/fixtures/configmap-file-configs/output-k8s-2.yaml +++ b/script/test/fixtures/configmap-file-configs/output-k8s-2.yaml @@ -33,7 +33,6 @@ spec: template: metadata: labels: - io.kompose.network/configmap-file-configs-default: "true" io.kompose.service: busy spec: containers: diff --git a/script/test/fixtures/configmap-file-configs/output-k8s-3.yaml b/script/test/fixtures/configmap-file-configs/output-k8s-3.yaml index 79e2db5a6..ebe013ed5 100644 --- a/script/test/fixtures/configmap-file-configs/output-k8s-3.yaml +++ b/script/test/fixtures/configmap-file-configs/output-k8s-3.yaml @@ -33,7 +33,6 @@ spec: template: metadata: labels: - io.kompose.network/configmap-file-configs-default: "true" io.kompose.service: busy spec: containers: diff --git a/script/test/fixtures/configmap-file-configs/output-os-1.yaml b/script/test/fixtures/configmap-file-configs/output-os-1.yaml index e26acb569..699796891 100644 --- a/script/test/fixtures/configmap-file-configs/output-os-1.yaml +++ b/script/test/fixtures/configmap-file-configs/output-os-1.yaml @@ -32,7 +32,6 @@ spec: template: metadata: labels: - io.kompose.network/configmap-file-configs-default: "true" io.kompose.service: busy spec: containers: diff --git a/script/test/fixtures/configmap-file-configs/output-os-2.yaml b/script/test/fixtures/configmap-file-configs/output-os-2.yaml index 5ce2fae8b..296f60fdd 100644 --- a/script/test/fixtures/configmap-file-configs/output-os-2.yaml +++ b/script/test/fixtures/configmap-file-configs/output-os-2.yaml @@ -32,7 +32,6 @@ spec: template: metadata: labels: - io.kompose.network/configmap-file-configs-default: "true" io.kompose.service: busy spec: containers: diff --git a/script/test/fixtures/configmap-file-configs/output-os-3.yaml b/script/test/fixtures/configmap-file-configs/output-os-3.yaml index 4e116d28b..ff51eb956 100644 --- a/script/test/fixtures/configmap-file-configs/output-os-3.yaml +++ b/script/test/fixtures/configmap-file-configs/output-os-3.yaml @@ -32,7 +32,6 @@ spec: template: metadata: labels: - io.kompose.network/configmap-file-configs-default: "true" io.kompose.service: busy spec: containers: diff --git a/script/test/fixtures/configmap-pod/output-k8s.yaml b/script/test/fixtures/configmap-pod/output-k8s.yaml index 9b3860a2b..04bf4198d 100644 --- a/script/test/fixtures/configmap-pod/output-k8s.yaml +++ b/script/test/fixtures/configmap-pod/output-k8s.yaml @@ -19,7 +19,6 @@ apiVersion: v1 kind: Pod metadata: labels: - io.kompose.network/configmap-pod-default: "true" io.kompose.service: redis name: redis spec: diff --git a/script/test/fixtures/configmap-pod/output-os.yaml b/script/test/fixtures/configmap-pod/output-os.yaml index 9b3860a2b..04bf4198d 100644 --- a/script/test/fixtures/configmap-pod/output-os.yaml +++ b/script/test/fixtures/configmap-pod/output-os.yaml @@ -19,7 +19,6 @@ apiVersion: v1 kind: Pod metadata: labels: - io.kompose.network/configmap-pod-default: "true" io.kompose.service: redis name: redis spec: diff --git a/script/test/fixtures/configmap-volume/output-k8s-withlabel.yaml b/script/test/fixtures/configmap-volume/output-k8s-withlabel.yaml index 21d3a4242..1abc9f9ff 100644 --- a/script/test/fixtures/configmap-volume/output-k8s-withlabel.yaml +++ b/script/test/fixtures/configmap-volume/output-k8s-withlabel.yaml @@ -15,7 +15,6 @@ spec: template: metadata: labels: - io.kompose.network/configmap-volume-default: "true" io.kompose.service: db spec: containers: @@ -63,7 +62,6 @@ spec: template: metadata: labels: - io.kompose.network/configmap-volume-default: "true" io.kompose.service: web spec: containers: diff --git a/script/test/fixtures/configmap-volume/output-k8s.yaml b/script/test/fixtures/configmap-volume/output-k8s.yaml index e3c2b84d0..c7c2b0a25 100644 --- a/script/test/fixtures/configmap-volume/output-k8s.yaml +++ b/script/test/fixtures/configmap-volume/output-k8s.yaml @@ -15,7 +15,6 @@ spec: template: metadata: labels: - io.kompose.network/configmap-volume-default: "true" io.kompose.service: db spec: containers: @@ -64,7 +63,6 @@ spec: template: metadata: labels: - io.kompose.network/configmap-volume-default: "true" io.kompose.service: web spec: containers: diff --git a/script/test/fixtures/configmap-volume/output-os-withlabel.yaml b/script/test/fixtures/configmap-volume/output-os-withlabel.yaml index ae9679d72..9ee37614a 100644 --- a/script/test/fixtures/configmap-volume/output-os-withlabel.yaml +++ b/script/test/fixtures/configmap-volume/output-os-withlabel.yaml @@ -14,7 +14,6 @@ spec: template: metadata: labels: - io.kompose.network/configmap-volume-default: "true" io.kompose.service: db spec: containers: @@ -90,7 +89,6 @@ spec: template: metadata: labels: - io.kompose.network/configmap-volume-default: "true" io.kompose.service: web spec: containers: diff --git a/script/test/fixtures/configmap-volume/output-os.yaml b/script/test/fixtures/configmap-volume/output-os.yaml index d9e5b1835..22684221f 100644 --- a/script/test/fixtures/configmap-volume/output-os.yaml +++ b/script/test/fixtures/configmap-volume/output-os.yaml @@ -14,7 +14,6 @@ spec: template: metadata: labels: - io.kompose.network/configmap-volume-default: "true" io.kompose.service: db spec: containers: @@ -91,7 +90,6 @@ spec: template: metadata: labels: - io.kompose.network/configmap-volume-default: "true" io.kompose.service: web spec: containers: diff --git a/script/test/fixtures/cronjob/output-k8s.yaml b/script/test/fixtures/cronjob/output-k8s.yaml index 9e9f105b5..6f88603ee 100644 --- a/script/test/fixtures/cronjob/output-k8s.yaml +++ b/script/test/fixtures/cronjob/output-k8s.yaml @@ -13,7 +13,6 @@ spec: template: metadata: labels: - io.kompose.network/cronjob-default: "true" io.kompose.service: challenge spec: containers: diff --git a/script/test/fixtures/cronjob/output-os.yaml b/script/test/fixtures/cronjob/output-os.yaml index 9e9f105b5..6f88603ee 100644 --- a/script/test/fixtures/cronjob/output-os.yaml +++ b/script/test/fixtures/cronjob/output-os.yaml @@ -13,7 +13,6 @@ spec: template: metadata: labels: - io.kompose.network/cronjob-default: "true" io.kompose.service: challenge spec: containers: diff --git a/script/test/fixtures/deploy/placement/output-placement-k8s.yaml b/script/test/fixtures/deploy/placement/output-placement-k8s.yaml index 721cc1342..f63d314c3 100644 --- a/script/test/fixtures/deploy/placement/output-placement-k8s.yaml +++ b/script/test/fixtures/deploy/placement/output-placement-k8s.yaml @@ -28,7 +28,6 @@ spec: template: metadata: labels: - io.kompose.network/placement-default: "true" io.kompose.service: redis spec: affinity: diff --git a/script/test/fixtures/deploy/placement/output-placement-os.yaml b/script/test/fixtures/deploy/placement/output-placement-os.yaml index 39b95b870..365564190 100644 --- a/script/test/fixtures/deploy/placement/output-placement-os.yaml +++ b/script/test/fixtures/deploy/placement/output-placement-os.yaml @@ -27,7 +27,6 @@ spec: template: metadata: labels: - io.kompose.network/placement-default: "true" io.kompose.service: redis spec: affinity: diff --git a/script/test/fixtures/env-multiple/output-k8s.yaml b/script/test/fixtures/env-multiple/output-k8s.yaml index c3d04ced7..ab3269b3d 100644 --- a/script/test/fixtures/env-multiple/output-k8s.yaml +++ b/script/test/fixtures/env-multiple/output-k8s.yaml @@ -56,7 +56,6 @@ spec: metadata: creationTimestamp: null labels: - io.kompose.network/env-default: "true" io.kompose.service: another-namenode spec: containers: @@ -117,7 +116,6 @@ spec: metadata: creationTimestamp: null labels: - io.kompose.network/env-default: "true" io.kompose.service: namenode spec: containers: diff --git a/script/test/fixtures/env-multiple/output-os.yaml b/script/test/fixtures/env-multiple/output-os.yaml index 86d92eb3e..e6980304a 100644 --- a/script/test/fixtures/env-multiple/output-os.yaml +++ b/script/test/fixtures/env-multiple/output-os.yaml @@ -78,7 +78,6 @@ spec: metadata: creationTimestamp: null labels: - io.kompose.network/env-default: "true" io.kompose.service: another-namenode spec: containers: @@ -151,7 +150,6 @@ spec: metadata: creationTimestamp: null labels: - io.kompose.network/env-default: "true" io.kompose.service: namenode spec: containers: diff --git a/script/test/fixtures/env/output-k8s.yaml b/script/test/fixtures/env/output-k8s.yaml index 97d382b3d..974a042c3 100644 --- a/script/test/fixtures/env/output-k8s.yaml +++ b/script/test/fixtures/env/output-k8s.yaml @@ -49,7 +49,6 @@ spec: template: metadata: labels: - io.kompose.network/env-default: "true" io.kompose.service: another-namenode spec: containers: @@ -100,7 +99,6 @@ spec: template: metadata: labels: - io.kompose.network/env-default: "true" io.kompose.service: namenode spec: containers: diff --git a/script/test/fixtures/env/output-os.yaml b/script/test/fixtures/env/output-os.yaml index 06d751300..1f4ef079a 100644 --- a/script/test/fixtures/env/output-os.yaml +++ b/script/test/fixtures/env/output-os.yaml @@ -59,7 +59,6 @@ spec: template: metadata: labels: - io.kompose.network/env-default: "true" io.kompose.service: another-namenode spec: containers: @@ -126,7 +125,6 @@ spec: template: metadata: labels: - io.kompose.network/env-default: "true" io.kompose.service: namenode spec: containers: diff --git a/script/test/fixtures/envvars-interpolation/output-k8s.yaml b/script/test/fixtures/envvars-interpolation/output-k8s.yaml index 9c3f4cf1b..76a9652f6 100644 --- a/script/test/fixtures/envvars-interpolation/output-k8s.yaml +++ b/script/test/fixtures/envvars-interpolation/output-k8s.yaml @@ -13,7 +13,6 @@ spec: template: metadata: labels: - io.kompose.network/envvars-interpolation-default: "true" io.kompose.service: myservice spec: containers: diff --git a/script/test/fixtures/envvars-interpolation/output-os.yaml b/script/test/fixtures/envvars-interpolation/output-os.yaml index 48db9fc9f..1a3ed2535 100644 --- a/script/test/fixtures/envvars-interpolation/output-os.yaml +++ b/script/test/fixtures/envvars-interpolation/output-os.yaml @@ -12,7 +12,6 @@ spec: template: metadata: labels: - io.kompose.network/envvars-interpolation-default: "true" io.kompose.service: myservice spec: containers: diff --git a/script/test/fixtures/envvars-with-status/output-k8s.yaml b/script/test/fixtures/envvars-with-status/output-k8s.yaml index 2c5122c0e..c8dd1b420 100644 --- a/script/test/fixtures/envvars-with-status/output-k8s.yaml +++ b/script/test/fixtures/envvars-with-status/output-k8s.yaml @@ -28,7 +28,6 @@ spec: template: metadata: labels: - io.kompose.network/envvars-with-status-default: "true" io.kompose.service: app spec: containers: diff --git a/script/test/fixtures/envvars-with-status/output-os.yaml b/script/test/fixtures/envvars-with-status/output-os.yaml index 25e29eb98..f9652fcff 100644 --- a/script/test/fixtures/envvars-with-status/output-os.yaml +++ b/script/test/fixtures/envvars-with-status/output-os.yaml @@ -27,7 +27,6 @@ spec: template: metadata: labels: - io.kompose.network/envvars-with-status-default: "true" io.kompose.service: app spec: containers: diff --git a/script/test/fixtures/expose/output-k8s.yaml b/script/test/fixtures/expose/output-k8s.yaml index 34329f414..860a7bfdc 100644 --- a/script/test/fixtures/expose/output-k8s.yaml +++ b/script/test/fixtures/expose/output-k8s.yaml @@ -43,7 +43,6 @@ spec: template: metadata: labels: - io.kompose.network/expose-default: "true" io.kompose.service: redis spec: containers: @@ -69,7 +68,6 @@ spec: template: metadata: labels: - io.kompose.network/expose-default: "true" io.kompose.service: web spec: containers: diff --git a/script/test/fixtures/expose/output-os.yaml b/script/test/fixtures/expose/output-os.yaml index 90b704e31..1ad6b8f2b 100644 --- a/script/test/fixtures/expose/output-os.yaml +++ b/script/test/fixtures/expose/output-os.yaml @@ -42,7 +42,6 @@ spec: template: metadata: labels: - io.kompose.network/expose-default: "true" io.kompose.service: redis spec: containers: @@ -96,7 +95,6 @@ spec: template: metadata: labels: - io.kompose.network/expose-default: "true" io.kompose.service: web spec: containers: diff --git a/script/test/fixtures/external-traffic-policy/output-k8s-v1.yaml b/script/test/fixtures/external-traffic-policy/output-k8s-v1.yaml index 5e6ce3df1..f6390a0cf 100644 --- a/script/test/fixtures/external-traffic-policy/output-k8s-v1.yaml +++ b/script/test/fixtures/external-traffic-policy/output-k8s-v1.yaml @@ -30,7 +30,6 @@ spec: template: metadata: labels: - io.kompose.network/external-traffic-policy-default: "true" io.kompose.service: front-end spec: containers: diff --git a/script/test/fixtures/external-traffic-policy/output-k8s-v2.yaml b/script/test/fixtures/external-traffic-policy/output-k8s-v2.yaml index d045665b0..2c3d84f8f 100644 --- a/script/test/fixtures/external-traffic-policy/output-k8s-v2.yaml +++ b/script/test/fixtures/external-traffic-policy/output-k8s-v2.yaml @@ -30,7 +30,6 @@ spec: template: metadata: labels: - io.kompose.network/external-traffic-policy-default: "true" io.kompose.service: front-end spec: containers: diff --git a/script/test/fixtures/external-traffic-policy/output-os-v1.yaml b/script/test/fixtures/external-traffic-policy/output-os-v1.yaml index b39f37763..8df895fb6 100644 --- a/script/test/fixtures/external-traffic-policy/output-os-v1.yaml +++ b/script/test/fixtures/external-traffic-policy/output-os-v1.yaml @@ -29,7 +29,6 @@ spec: template: metadata: labels: - io.kompose.network/external-traffic-policy-default: "true" io.kompose.service: front-end spec: containers: diff --git a/script/test/fixtures/external-traffic-policy/output-os-v2.yaml b/script/test/fixtures/external-traffic-policy/output-os-v2.yaml index e3ab3c880..f91ca4a34 100644 --- a/script/test/fixtures/external-traffic-policy/output-os-v2.yaml +++ b/script/test/fixtures/external-traffic-policy/output-os-v2.yaml @@ -29,7 +29,6 @@ spec: template: metadata: labels: - io.kompose.network/external-traffic-policy-default: "true" io.kompose.service: front-end spec: containers: diff --git a/script/test/fixtures/fsgroup/output-k8s.yaml b/script/test/fixtures/fsgroup/output-k8s.yaml index a82cb221d..8408eec8c 100644 --- a/script/test/fixtures/fsgroup/output-k8s.yaml +++ b/script/test/fixtures/fsgroup/output-k8s.yaml @@ -15,7 +15,6 @@ spec: template: metadata: labels: - io.kompose.network/fsgroup-default: "true" io.kompose.service: pgadmin spec: containers: diff --git a/script/test/fixtures/fsgroup/output-os.yaml b/script/test/fixtures/fsgroup/output-os.yaml index 3fc723362..994e24d99 100644 --- a/script/test/fixtures/fsgroup/output-os.yaml +++ b/script/test/fixtures/fsgroup/output-os.yaml @@ -14,7 +14,6 @@ spec: template: metadata: labels: - io.kompose.network/fsgroup-default: "true" io.kompose.service: pgadmin spec: containers: diff --git a/script/test/fixtures/healthcheck/output-healthcheck-k8s.yaml b/script/test/fixtures/healthcheck/output-healthcheck-k8s.yaml index 9534dc65b..4beb6586d 100644 --- a/script/test/fixtures/healthcheck/output-healthcheck-k8s.yaml +++ b/script/test/fixtures/healthcheck/output-healthcheck-k8s.yaml @@ -73,7 +73,6 @@ spec: template: metadata: labels: - io.kompose.network/healthcheck-default: "true" io.kompose.service: mongo spec: containers: @@ -111,7 +110,6 @@ spec: template: metadata: labels: - io.kompose.network/healthcheck-default: "true" io.kompose.service: mysql spec: containers: @@ -149,7 +147,6 @@ spec: template: metadata: labels: - io.kompose.network/healthcheck-default: "true" io.kompose.service: postgresql spec: containers: @@ -189,7 +186,6 @@ spec: template: metadata: labels: - io.kompose.network/healthcheck-default: "true" io.kompose.service: redis spec: containers: diff --git a/script/test/fixtures/healthcheck/output-healthcheck-os.yaml b/script/test/fixtures/healthcheck/output-healthcheck-os.yaml index e25f69814..62f129af1 100644 --- a/script/test/fixtures/healthcheck/output-healthcheck-os.yaml +++ b/script/test/fixtures/healthcheck/output-healthcheck-os.yaml @@ -72,7 +72,6 @@ spec: template: metadata: labels: - io.kompose.network/healthcheck-default: "true" io.kompose.service: mongo spec: containers: @@ -138,7 +137,6 @@ spec: template: metadata: labels: - io.kompose.network/healthcheck-default: "true" io.kompose.service: mysql spec: containers: @@ -204,7 +202,6 @@ spec: template: metadata: labels: - io.kompose.network/healthcheck-default: "true" io.kompose.service: postgresql spec: containers: @@ -272,7 +269,6 @@ spec: template: metadata: labels: - io.kompose.network/healthcheck-default: "true" io.kompose.service: redis spec: containers: diff --git a/script/test/fixtures/host-port-protocol/output-k8s.yaml b/script/test/fixtures/host-port-protocol/output-k8s.yaml index abf7c10c8..3342742cf 100644 --- a/script/test/fixtures/host-port-protocol/output-k8s.yaml +++ b/script/test/fixtures/host-port-protocol/output-k8s.yaml @@ -28,7 +28,6 @@ spec: template: metadata: labels: - io.kompose.network/host-port-protocol-default: "true" io.kompose.service: nginx spec: containers: diff --git a/script/test/fixtures/host-port-protocol/output-os.yaml b/script/test/fixtures/host-port-protocol/output-os.yaml index db98f87b9..69049d48d 100644 --- a/script/test/fixtures/host-port-protocol/output-os.yaml +++ b/script/test/fixtures/host-port-protocol/output-os.yaml @@ -27,7 +27,6 @@ spec: template: metadata: labels: - io.kompose.network/host-port-protocol-default: "true" io.kompose.service: nginx spec: containers: diff --git a/script/test/fixtures/hpa/output-k8s.yaml b/script/test/fixtures/hpa/output-k8s.yaml index 6f249d29d..1d67a8cf6 100644 --- a/script/test/fixtures/hpa/output-k8s.yaml +++ b/script/test/fixtures/hpa/output-k8s.yaml @@ -13,7 +13,6 @@ spec: template: metadata: labels: - io.kompose.network/hpa-default: "true" io.kompose.service: web spec: containers: diff --git a/script/test/fixtures/initcontainer/output-k8s.yaml b/script/test/fixtures/initcontainer/output-k8s.yaml index 68dd7d887..c4b7d31e4 100644 --- a/script/test/fixtures/initcontainer/output-k8s.yaml +++ b/script/test/fixtures/initcontainer/output-k8s.yaml @@ -13,7 +13,6 @@ spec: template: metadata: labels: - io.kompose.network/initcontainer-default: "true" io.kompose.service: web spec: containers: diff --git a/script/test/fixtures/multiple-files/output-k8s.yaml b/script/test/fixtures/multiple-files/output-k8s.yaml index de30891f6..20aab8316 100644 --- a/script/test/fixtures/multiple-files/output-k8s.yaml +++ b/script/test/fixtures/multiple-files/output-k8s.yaml @@ -13,7 +13,6 @@ spec: template: metadata: labels: - io.kompose.network/multiple-files-default: "true" io.kompose.service: bar spec: containers: @@ -37,7 +36,6 @@ spec: template: metadata: labels: - io.kompose.network/multiple-files-default: "true" io.kompose.service: foo spec: containers: diff --git a/script/test/fixtures/multiple-files/output-os.yaml b/script/test/fixtures/multiple-files/output-os.yaml index 77e2f22ad..19b3d49a7 100644 --- a/script/test/fixtures/multiple-files/output-os.yaml +++ b/script/test/fixtures/multiple-files/output-os.yaml @@ -12,7 +12,6 @@ spec: template: metadata: labels: - io.kompose.network/multiple-files-default: "true" io.kompose.service: bar spec: containers: @@ -63,7 +62,6 @@ spec: template: metadata: labels: - io.kompose.network/multiple-files-default: "true" io.kompose.service: foo spec: containers: diff --git a/script/test/fixtures/multiple-type-volumes/output-k8s.yaml b/script/test/fixtures/multiple-type-volumes/output-k8s.yaml index f58c41cc2..c7a4eaf15 100644 --- a/script/test/fixtures/multiple-type-volumes/output-k8s.yaml +++ b/script/test/fixtures/multiple-type-volumes/output-k8s.yaml @@ -15,7 +15,6 @@ spec: template: metadata: labels: - io.kompose.network/multiple-type-volumes-default: "true" io.kompose.service: db spec: containers: @@ -61,7 +60,6 @@ spec: template: metadata: labels: - io.kompose.network/multiple-type-volumes-default: "true" io.kompose.service: web spec: containers: diff --git a/script/test/fixtures/multiple-type-volumes/output-os.yaml b/script/test/fixtures/multiple-type-volumes/output-os.yaml index 9ed057c3d..5940ef48c 100644 --- a/script/test/fixtures/multiple-type-volumes/output-os.yaml +++ b/script/test/fixtures/multiple-type-volumes/output-os.yaml @@ -14,7 +14,6 @@ spec: template: metadata: labels: - io.kompose.network/multiple-type-volumes-default: "true" io.kompose.service: db spec: containers: @@ -88,7 +87,6 @@ spec: template: metadata: labels: - io.kompose.network/multiple-type-volumes-default: "true" io.kompose.service: web spec: containers: diff --git a/script/test/fixtures/namespace/output-k8s.yaml b/script/test/fixtures/namespace/output-k8s.yaml index 9600c60d1..734656949 100644 --- a/script/test/fixtures/namespace/output-k8s.yaml +++ b/script/test/fixtures/namespace/output-k8s.yaml @@ -39,7 +39,6 @@ spec: template: metadata: labels: - io.kompose.network/namespace-default: "true" io.kompose.service: web spec: containers: diff --git a/script/test/fixtures/namespace/output-os.yaml b/script/test/fixtures/namespace/output-os.yaml index b679011ae..cb0dd5b12 100644 --- a/script/test/fixtures/namespace/output-os.yaml +++ b/script/test/fixtures/namespace/output-os.yaml @@ -36,7 +36,6 @@ spec: template: metadata: labels: - io.kompose.network/namespace-default: "true" io.kompose.service: web spec: containers: diff --git a/script/test/fixtures/network-mode-service/output-k8s.yaml b/script/test/fixtures/network-mode-service/output-k8s.yaml index d86735e52..c60182f87 100644 --- a/script/test/fixtures/network-mode-service/output-k8s.yaml +++ b/script/test/fixtures/network-mode-service/output-k8s.yaml @@ -28,7 +28,6 @@ spec: template: metadata: labels: - io.kompose.network/network-mode-service-default: "true" io.kompose.service: client spec: containers: diff --git a/script/test/fixtures/read-only/output-k8s.yaml b/script/test/fixtures/read-only/output-k8s.yaml index 5f8a31de5..8b0bdda19 100644 --- a/script/test/fixtures/read-only/output-k8s.yaml +++ b/script/test/fixtures/read-only/output-k8s.yaml @@ -29,7 +29,6 @@ spec: template: metadata: labels: - io.kompose.network/read-only-default: "true" io.kompose.service: test spec: containers: diff --git a/script/test/fixtures/read-only/output-os.yaml b/script/test/fixtures/read-only/output-os.yaml index f6a412298..2f01c8e4d 100644 --- a/script/test/fixtures/read-only/output-os.yaml +++ b/script/test/fixtures/read-only/output-os.yaml @@ -27,7 +27,6 @@ spec: template: metadata: labels: - io.kompose.network/read-only-default: "true" io.kompose.service: test spec: containers: diff --git a/script/test/fixtures/resources-lowercase/output-k8s.yaml b/script/test/fixtures/resources-lowercase/output-k8s.yaml index 192cb4731..f2a81a2a8 100644 --- a/script/test/fixtures/resources-lowercase/output-k8s.yaml +++ b/script/test/fixtures/resources-lowercase/output-k8s.yaml @@ -28,7 +28,6 @@ spec: template: metadata: labels: - io.kompose.network/resources-lowercase-default: "true" io.kompose.service: nginx spec: containers: diff --git a/script/test/fixtures/resources-lowercase/output-os.yaml b/script/test/fixtures/resources-lowercase/output-os.yaml index 64c91c49c..2f6e662aa 100644 --- a/script/test/fixtures/resources-lowercase/output-os.yaml +++ b/script/test/fixtures/resources-lowercase/output-os.yaml @@ -27,7 +27,6 @@ spec: template: metadata: labels: - io.kompose.network/resources-lowercase-default: "true" io.kompose.service: nginx spec: containers: diff --git a/script/test/fixtures/service-group/output-k8s.yaml b/script/test/fixtures/service-group/output-k8s.yaml index 97efe56cf..62ad4edcc 100644 --- a/script/test/fixtures/service-group/output-k8s.yaml +++ b/script/test/fixtures/service-group/output-k8s.yaml @@ -31,7 +31,6 @@ spec: template: metadata: labels: - io.kompose.network/service-group-default: "true" io.kompose.service: librenms-dispatcher spec: containers: diff --git a/script/test/fixtures/single-file-output/output-k8s.yaml b/script/test/fixtures/single-file-output/output-k8s.yaml index 48569c07f..7a01db7e2 100644 --- a/script/test/fixtures/single-file-output/output-k8s.yaml +++ b/script/test/fixtures/single-file-output/output-k8s.yaml @@ -28,7 +28,6 @@ spec: template: metadata: labels: - io.kompose.network/single-file-output-default: "true" io.kompose.service: front-end spec: containers: diff --git a/script/test/fixtures/statefulset/output-k8s.yaml b/script/test/fixtures/statefulset/output-k8s.yaml index 1f6d12452..e9bf013e5 100644 --- a/script/test/fixtures/statefulset/output-k8s.yaml +++ b/script/test/fixtures/statefulset/output-k8s.yaml @@ -50,7 +50,6 @@ spec: template: metadata: labels: - io.kompose.network/statefulset-default: "true" io.kompose.service: db spec: containers: @@ -100,7 +99,6 @@ spec: template: metadata: labels: - io.kompose.network/statefulset-default: "true" io.kompose.service: wordpress spec: containers: diff --git a/script/test/fixtures/statefulset/output-os.yaml b/script/test/fixtures/statefulset/output-os.yaml index eef113c78..fe6aa3021 100644 --- a/script/test/fixtures/statefulset/output-os.yaml +++ b/script/test/fixtures/statefulset/output-os.yaml @@ -46,7 +46,6 @@ spec: template: metadata: labels: - io.kompose.network/statefulset-default: "true" io.kompose.service: db spec: containers: @@ -96,7 +95,6 @@ spec: template: metadata: labels: - io.kompose.network/statefulset-default: "true" io.kompose.service: db spec: containers: @@ -166,7 +164,6 @@ spec: template: metadata: labels: - io.kompose.network/statefulset-default: "true" io.kompose.service: wordpress spec: containers: @@ -216,7 +213,6 @@ spec: template: metadata: labels: - io.kompose.network/statefulset-default: "true" io.kompose.service: wordpress spec: containers: diff --git a/script/test/fixtures/v2/output-k8s.yaml b/script/test/fixtures/v2/output-k8s.yaml index 8441a6940..6cea9ec40 100644 --- a/script/test/fixtures/v2/output-k8s.yaml +++ b/script/test/fixtures/v2/output-k8s.yaml @@ -121,7 +121,6 @@ apiVersion: v1 kind: Pod metadata: labels: - io.kompose.network/v2-default: "true" io.kompose.service: foo name: foo spec: @@ -203,7 +202,6 @@ spec: template: metadata: labels: - io.kompose.network/v2-default: "true" io.kompose.service: redis spec: containers: diff --git a/script/test/fixtures/v2/output-os.yaml b/script/test/fixtures/v2/output-os.yaml index 3da0291af..af6351ee6 100644 --- a/script/test/fixtures/v2/output-os.yaml +++ b/script/test/fixtures/v2/output-os.yaml @@ -121,7 +121,6 @@ apiVersion: v1 kind: Pod metadata: labels: - io.kompose.network/v2-default: "true" io.kompose.service: foo name: foo spec: @@ -202,7 +201,6 @@ spec: template: metadata: labels: - io.kompose.network/v2-default: "true" io.kompose.service: redis spec: containers: diff --git a/script/test/fixtures/v3.0/output-k8s.yaml b/script/test/fixtures/v3.0/output-k8s.yaml index f5ca1f9bd..b099119d1 100644 --- a/script/test/fixtures/v3.0/output-k8s.yaml +++ b/script/test/fixtures/v3.0/output-k8s.yaml @@ -29,9 +29,6 @@ spec: template: metadata: labels: - io.kompose.network/app-network: "true" - io.kompose.network/v30-normalized-network: "true" - io.kompose.network/web-network: "true" io.kompose.service: foo spec: containers: @@ -58,7 +55,6 @@ spec: template: metadata: labels: - io.kompose.network/v30-default: "true" io.kompose.service: redis spec: containers: diff --git a/script/test/fixtures/v3.0/output-os.yaml b/script/test/fixtures/v3.0/output-os.yaml index 6306d761b..96e8ac0f7 100644 --- a/script/test/fixtures/v3.0/output-os.yaml +++ b/script/test/fixtures/v3.0/output-os.yaml @@ -28,9 +28,6 @@ spec: template: metadata: labels: - io.kompose.network/app-network: "true" - io.kompose.network/v30-normalized-network: "true" - io.kompose.network/web-network: "true" io.kompose.service: foo spec: containers: @@ -85,7 +82,6 @@ spec: template: metadata: labels: - io.kompose.network/v30-default: "true" io.kompose.service: redis spec: containers: diff --git a/script/test/fixtures/vols-subpath/output-k8s.yaml b/script/test/fixtures/vols-subpath/output-k8s.yaml index dbd8619ce..2dd8bcf12 100644 --- a/script/test/fixtures/vols-subpath/output-k8s.yaml +++ b/script/test/fixtures/vols-subpath/output-k8s.yaml @@ -15,7 +15,6 @@ spec: template: metadata: labels: - io.kompose.network/vols-subpath-default: "true" io.kompose.service: postgres spec: containers: diff --git a/script/test/fixtures/vols-subpath/output-os.yaml b/script/test/fixtures/vols-subpath/output-os.yaml index b8fb0014a..ac633f187 100644 --- a/script/test/fixtures/vols-subpath/output-os.yaml +++ b/script/test/fixtures/vols-subpath/output-os.yaml @@ -14,7 +14,6 @@ spec: template: metadata: labels: - io.kompose.network/vols-subpath-default: "true" io.kompose.service: postgres spec: containers: diff --git a/script/test/fixtures/volume-mounts/windows/output-k8s.yaml b/script/test/fixtures/volume-mounts/windows/output-k8s.yaml index efd0ce8c3..4317e9b30 100644 --- a/script/test/fixtures/volume-mounts/windows/output-k8s.yaml +++ b/script/test/fixtures/volume-mounts/windows/output-k8s.yaml @@ -30,7 +30,6 @@ spec: template: metadata: labels: - io.kompose.network/windows-default: "true" io.kompose.service: db spec: containers: diff --git a/script/test/fixtures/volume-mounts/windows/output-os.yaml b/script/test/fixtures/volume-mounts/windows/output-os.yaml index 1def28caa..df5ccaca7 100644 --- a/script/test/fixtures/volume-mounts/windows/output-os.yaml +++ b/script/test/fixtures/volume-mounts/windows/output-os.yaml @@ -30,7 +30,6 @@ spec: template: metadata: labels: - io.kompose.network/windows-default: "true" io.kompose.service: db spec: containers: