From 21d8dc8a8143bdfaaeb1c5e736162fd31d5b962b Mon Sep 17 00:00:00 2001 From: shubhindia Date: Sun, 29 Oct 2023 11:53:19 +0530 Subject: [PATCH 1/4] drop status field from yamls Signed-off-by: shubhindia --- pkg/transformer/utils.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pkg/transformer/utils.go b/pkg/transformer/utils.go index 7caba1d3e..f78c3deea 100644 --- a/pkg/transformer/utils.go +++ b/pkg/transformer/utils.go @@ -22,6 +22,7 @@ import ( "os/exec" "path" "path/filepath" + "regexp" "strings" dockerlib "github.com/fsouza/go-dockerclient" @@ -274,6 +275,10 @@ func ConfigAnnotations(service kobject.ServiceConfig) map[string]string { // Print either prints to stdout or to file/s func Print(name, path string, trailing string, data []byte, toStdout, generateJSON bool, f *os.File, provider string) (string, error) { file := "" + // simple hack to remove status from the output + re := regexp.MustCompile(`(?s)status:.*`) + data = re.ReplaceAll(data, nil) + if generateJSON { file = fmt.Sprintf("%s-%s.json", name, trailing) } else { From 9d3dfeab419c4c54c85ac2d4ba6bbd4039e8a908 Mon Sep 17 00:00:00 2001 From: shubhindia Date: Sun, 29 Oct 2023 12:08:59 +0530 Subject: [PATCH 2/4] drop status field from test yamls Signed-off-by: shubhindia --- .../output-k8s-empty-vols-template.yaml | 10 ++++------ .../fixtures/change-in-volume/output-k8s.yaml | 10 ++++------ .../output-os-empty-vols-template.yaml | 6 ++---- .../fixtures/change-in-volume/output-os.yaml | 6 ++---- .../compose-env-interpolation/output-k8s.yaml | 5 ++--- .../compose-file-support/output-k8s.yaml | 5 ++--- .../output-k8s-withlabel.yaml | 4 ++-- .../fixtures/configmap-volume/output-k8s.yaml | 4 ++-- .../placement/output-placement-k8s.yaml | 5 ++--- .../deploy/placement/output-placement-os.yaml | 3 +-- .../fixtures/env-multiple/output-k8s.yaml | 10 ++++------ .../test/fixtures/env-multiple/output-os.yaml | 6 ++---- script/test/fixtures/env/output-k8s.yaml | 10 ++++------ script/test/fixtures/env/output-os.yaml | 6 ++---- .../envvars-interpolation/output-k8s.yaml | 2 +- script/test/fixtures/expose/output-k8s.yaml | 13 +++++------- script/test/fixtures/expose/output-os.yaml | 6 ++---- .../output-k8s-v1.yaml | 5 ++--- .../output-k8s-v2.yaml | 8 +++----- .../external-traffic-policy/output-os-v1.yaml | 3 +-- .../external-traffic-policy/output-os-v2.yaml | 3 +-- script/test/fixtures/fsgroup/output-k8s.yaml | 4 ++-- script/test/fixtures/fsgroup/output-os.yaml | 2 +- .../healthcheck/output-healthcheck-k8s.yaml | 20 ++++++++----------- .../healthcheck/output-healthcheck-os.yaml | 12 ++++------- .../host-port-protocol/output-k8s.yaml | 5 ++--- .../host-port-protocol/output-os.yaml | 3 +-- .../fixtures/multiple-files/output-k8s.yaml | 4 ++-- .../multiple-type-volumes/output-k8s.yaml | 6 +++--- .../multiple-type-volumes/output-os.yaml | 2 +- .../test/fixtures/namespace/output-k8s.yaml | 7 +++---- script/test/fixtures/namespace/output-os.yaml | 5 ++--- .../fixtures/network-policies/output-k8s.yaml | 5 ++--- .../test/fixtures/read-only/output-k8s.yaml | 5 ++--- script/test/fixtures/read-only/output-os.yaml | 3 +-- .../fixtures/service-group/output-k8s.yaml | 7 +++---- .../single-file-output/output-k8s.yaml | 8 +++----- .../test/fixtures/statefulset/output-k8s.yaml | 10 ++++------ .../test/fixtures/statefulset/output-os.yaml | 10 ++++------ script/test/fixtures/v2/output-k8s.yaml | 8 -------- script/test/fixtures/v2/output-os.yaml | 11 ++++------ script/test/fixtures/v3.0/output-k8s.yaml | 4 ---- script/test/fixtures/v3.0/output-os.yaml | 3 +-- .../fixtures/vols-subpath/output-k8s.yaml | 4 ++-- .../test/fixtures/vols-subpath/output-os.yaml | 2 +- .../volume-mounts/windows/output-k8s.yaml | 4 ---- .../volume-mounts/windows/output-os.yaml | 5 ++--- 47 files changed, 108 insertions(+), 181 deletions(-) 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 673e998f2..13cdc7115 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 @@ -16,8 +16,7 @@ spec: targetPort: 0 selector: io.kompose.service: redis -status: - loadBalancer: {} + --- apiVersion: v1 @@ -34,8 +33,7 @@ spec: targetPort: 5000 selector: io.kompose.service: web -status: - loadBalancer: {} + --- apiVersion: apps/v1 @@ -67,7 +65,7 @@ spec: name: redis resources: {} restartPolicy: Always -status: {} + --- apiVersion: apps/v1 @@ -109,5 +107,5 @@ spec: volumes: - emptyDir: {} name: code-volume -status: {} + diff --git a/script/test/fixtures/change-in-volume/output-k8s.yaml b/script/test/fixtures/change-in-volume/output-k8s.yaml index 673e998f2..13cdc7115 100644 --- a/script/test/fixtures/change-in-volume/output-k8s.yaml +++ b/script/test/fixtures/change-in-volume/output-k8s.yaml @@ -16,8 +16,7 @@ spec: targetPort: 0 selector: io.kompose.service: redis -status: - loadBalancer: {} + --- apiVersion: v1 @@ -34,8 +33,7 @@ spec: targetPort: 5000 selector: io.kompose.service: web -status: - loadBalancer: {} + --- apiVersion: apps/v1 @@ -67,7 +65,7 @@ spec: name: redis resources: {} restartPolicy: Always -status: {} + --- apiVersion: apps/v1 @@ -109,5 +107,5 @@ spec: volumes: - emptyDir: {} name: code-volume -status: {} + 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 40061b7a1..0db502c9b 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 @@ -16,8 +16,7 @@ spec: targetPort: 0 selector: io.kompose.service: redis -status: - loadBalancer: {} + --- apiVersion: v1 @@ -34,8 +33,7 @@ spec: targetPort: 5000 selector: io.kompose.service: web -status: - loadBalancer: {} + --- apiVersion: apps.openshift.io/v1 diff --git a/script/test/fixtures/change-in-volume/output-os.yaml b/script/test/fixtures/change-in-volume/output-os.yaml index 40061b7a1..0db502c9b 100644 --- a/script/test/fixtures/change-in-volume/output-os.yaml +++ b/script/test/fixtures/change-in-volume/output-os.yaml @@ -16,8 +16,7 @@ spec: targetPort: 0 selector: io.kompose.service: redis -status: - loadBalancer: {} + --- apiVersion: v1 @@ -34,8 +33,7 @@ spec: targetPort: 5000 selector: io.kompose.service: web -status: - loadBalancer: {} + --- apiVersion: apps.openshift.io/v1 diff --git a/script/test/fixtures/compose-env-interpolation/output-k8s.yaml b/script/test/fixtures/compose-env-interpolation/output-k8s.yaml index 4bdcc1c13..f1a33b5a8 100644 --- a/script/test/fixtures/compose-env-interpolation/output-k8s.yaml +++ b/script/test/fixtures/compose-env-interpolation/output-k8s.yaml @@ -15,8 +15,7 @@ spec: targetPort: 80 selector: io.kompose.service: foo -status: - loadBalancer: {} + --- apiVersion: apps/v1 @@ -53,5 +52,5 @@ spec: protocol: TCP resources: {} restartPolicy: Always -status: {} + diff --git a/script/test/fixtures/compose-file-support/output-k8s.yaml b/script/test/fixtures/compose-file-support/output-k8s.yaml index 1ca00e60e..b0df54af0 100644 --- a/script/test/fixtures/compose-file-support/output-k8s.yaml +++ b/script/test/fixtures/compose-file-support/output-k8s.yaml @@ -13,8 +13,7 @@ spec: targetPort: 80 selector: io.kompose.service: web -status: - loadBalancer: {} + --- apiVersion: apps/v1 @@ -46,5 +45,5 @@ spec: protocol: TCP resources: {} restartPolicy: Always -status: {} + diff --git a/script/test/fixtures/configmap-volume/output-k8s-withlabel.yaml b/script/test/fixtures/configmap-volume/output-k8s-withlabel.yaml index 5e3c9d332..cbc4f995a 100644 --- a/script/test/fixtures/configmap-volume/output-k8s-withlabel.yaml +++ b/script/test/fixtures/configmap-volume/output-k8s-withlabel.yaml @@ -40,7 +40,7 @@ spec: path: configs.tar name: db-cm0 name: db-cm0 -status: {} + --- apiVersion: v1 @@ -102,7 +102,7 @@ spec: path: test-a-key.key name: web-cm1 name: web-cm1 -status: {} + --- apiVersion: v1 diff --git a/script/test/fixtures/configmap-volume/output-k8s.yaml b/script/test/fixtures/configmap-volume/output-k8s.yaml index 4baf157af..cb151b4a0 100644 --- a/script/test/fixtures/configmap-volume/output-k8s.yaml +++ b/script/test/fixtures/configmap-volume/output-k8s.yaml @@ -36,7 +36,7 @@ spec: path: configs.tar name: db-cm0 name: db-cm0 -status: {} + --- apiVersion: v1 @@ -94,7 +94,7 @@ spec: path: test-a-key.key name: web-cm1 name: web-cm1 -status: {} + --- apiVersion: v1 diff --git a/script/test/fixtures/deploy/placement/output-placement-k8s.yaml b/script/test/fixtures/deploy/placement/output-placement-k8s.yaml index 8005d35e9..023edb88d 100644 --- a/script/test/fixtures/deploy/placement/output-placement-k8s.yaml +++ b/script/test/fixtures/deploy/placement/output-placement-k8s.yaml @@ -13,8 +13,7 @@ spec: targetPort: 6379 selector: io.kompose.service: redis -status: - loadBalancer: {} + --- apiVersion: apps/v1 @@ -75,5 +74,5 @@ spec: maxSkew: 1 topologyKey: ssd whenUnsatisfiable: ScheduleAnyway -status: {} + diff --git a/script/test/fixtures/deploy/placement/output-placement-os.yaml b/script/test/fixtures/deploy/placement/output-placement-os.yaml index d59f6b4fb..87293e70a 100644 --- a/script/test/fixtures/deploy/placement/output-placement-os.yaml +++ b/script/test/fixtures/deploy/placement/output-placement-os.yaml @@ -13,8 +13,7 @@ spec: targetPort: 6379 selector: io.kompose.service: redis -status: - loadBalancer: {} + --- apiVersion: apps.openshift.io/v1 diff --git a/script/test/fixtures/env-multiple/output-k8s.yaml b/script/test/fixtures/env-multiple/output-k8s.yaml index d61ada19f..ae3d7bb35 100644 --- a/script/test/fixtures/env-multiple/output-k8s.yaml +++ b/script/test/fixtures/env-multiple/output-k8s.yaml @@ -16,8 +16,7 @@ spec: targetPort: 8020 selector: io.kompose.service: another-namenode -status: - loadBalancer: {} + --- apiVersion: v1 @@ -37,8 +36,7 @@ spec: targetPort: 8020 selector: io.kompose.service: namenode -status: - loadBalancer: {} + --- apiVersion: apps/v1 @@ -79,7 +77,7 @@ spec: protocol: TCP resources: {} restartPolicy: Always -status: {} + --- apiVersion: v1 @@ -144,5 +142,5 @@ spec: protocol: TCP resources: {} restartPolicy: Always -status: {} + diff --git a/script/test/fixtures/env-multiple/output-os.yaml b/script/test/fixtures/env-multiple/output-os.yaml index 57c426760..93f6d07b8 100644 --- a/script/test/fixtures/env-multiple/output-os.yaml +++ b/script/test/fixtures/env-multiple/output-os.yaml @@ -16,8 +16,7 @@ spec: targetPort: 8020 selector: io.kompose.service: another-namenode -status: - loadBalancer: {} + --- apiVersion: v1 @@ -37,8 +36,7 @@ spec: targetPort: 8020 selector: io.kompose.service: namenode -status: - loadBalancer: {} + --- apiVersion: v1 diff --git a/script/test/fixtures/env/output-k8s.yaml b/script/test/fixtures/env/output-k8s.yaml index f53119dab..463d41da2 100644 --- a/script/test/fixtures/env/output-k8s.yaml +++ b/script/test/fixtures/env/output-k8s.yaml @@ -16,8 +16,7 @@ spec: targetPort: 8020 selector: io.kompose.service: another-namenode -status: - loadBalancer: {} + --- apiVersion: v1 @@ -37,8 +36,7 @@ spec: targetPort: 8020 selector: io.kompose.service: namenode -status: - loadBalancer: {} + --- apiVersion: apps/v1 @@ -84,7 +82,7 @@ spec: protocol: TCP resources: {} restartPolicy: Always -status: {} + --- apiVersion: v1 @@ -144,5 +142,5 @@ spec: protocol: TCP resources: {} restartPolicy: Always -status: {} + diff --git a/script/test/fixtures/env/output-os.yaml b/script/test/fixtures/env/output-os.yaml index 487b57108..da1c8d177 100644 --- a/script/test/fixtures/env/output-os.yaml +++ b/script/test/fixtures/env/output-os.yaml @@ -16,8 +16,7 @@ spec: targetPort: 8020 selector: io.kompose.service: another-namenode -status: - loadBalancer: {} + --- apiVersion: v1 @@ -37,8 +36,7 @@ spec: targetPort: 8020 selector: io.kompose.service: namenode -status: - loadBalancer: {} + --- apiVersion: v1 diff --git a/script/test/fixtures/envvars-interpolation/output-k8s.yaml b/script/test/fixtures/envvars-interpolation/output-k8s.yaml index d9ccbd06d..66e983122 100644 --- a/script/test/fixtures/envvars-interpolation/output-k8s.yaml +++ b/script/test/fixtures/envvars-interpolation/output-k8s.yaml @@ -32,5 +32,5 @@ spec: name: myservice resources: {} restartPolicy: Always -status: {} + diff --git a/script/test/fixtures/expose/output-k8s.yaml b/script/test/fixtures/expose/output-k8s.yaml index 52ad4c7d1..4688b43b7 100644 --- a/script/test/fixtures/expose/output-k8s.yaml +++ b/script/test/fixtures/expose/output-k8s.yaml @@ -13,8 +13,7 @@ spec: targetPort: 6379 selector: io.kompose.service: redis -status: - loadBalancer: {} + --- apiVersion: v1 @@ -35,8 +34,7 @@ spec: targetPort: 5000 selector: io.kompose.service: web -status: - loadBalancer: {} + --- apiVersion: apps/v1 @@ -67,7 +65,7 @@ spec: protocol: TCP resources: {} restartPolicy: Always -status: {} + --- apiVersion: apps/v1 @@ -107,7 +105,7 @@ spec: protocol: TCP resources: {} restartPolicy: Always -status: {} + --- apiVersion: networking.k8s.io/v1 @@ -149,6 +147,5 @@ spec: - batman.example.com - batwoman.example.com secretName: test-secret -status: - loadBalancer: {} + diff --git a/script/test/fixtures/expose/output-os.yaml b/script/test/fixtures/expose/output-os.yaml index 149ceab4a..cfc61180d 100644 --- a/script/test/fixtures/expose/output-os.yaml +++ b/script/test/fixtures/expose/output-os.yaml @@ -13,8 +13,7 @@ spec: targetPort: 6379 selector: io.kompose.service: redis -status: - loadBalancer: {} + --- apiVersion: v1 @@ -35,8 +34,7 @@ spec: targetPort: 5000 selector: io.kompose.service: web -status: - loadBalancer: {} + --- apiVersion: apps.openshift.io/v1 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 aabc5a9ac..180fa5332 100644 --- a/script/test/fixtures/external-traffic-policy/output-k8s-v1.yaml +++ b/script/test/fixtures/external-traffic-policy/output-k8s-v1.yaml @@ -20,8 +20,7 @@ spec: selector: io.kompose.service: front-end type: LoadBalancer -status: - loadBalancer: {} + --- apiVersion: apps/v1 @@ -66,5 +65,5 @@ spec: protocol: TCP resources: {} restartPolicy: Always -status: {} + 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 391e21bb3..97a530b51 100644 --- a/script/test/fixtures/external-traffic-policy/output-k8s-v2.yaml +++ b/script/test/fixtures/external-traffic-policy/output-k8s-v2.yaml @@ -20,8 +20,7 @@ spec: selector: io.kompose.service: front-end type: ClusterIP -status: - loadBalancer: {} + --- apiVersion: apps/v1 @@ -66,7 +65,7 @@ spec: protocol: TCP resources: {} restartPolicy: Always -status: {} + --- apiVersion: networking.k8s.io/v1 @@ -94,6 +93,5 @@ spec: number: 80 path: / pathType: Prefix -status: - loadBalancer: {} + 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 6ce6a5df9..a7958ccdb 100644 --- a/script/test/fixtures/external-traffic-policy/output-os-v1.yaml +++ b/script/test/fixtures/external-traffic-policy/output-os-v1.yaml @@ -20,8 +20,7 @@ spec: selector: io.kompose.service: front-end type: LoadBalancer -status: - loadBalancer: {} + --- apiVersion: apps.openshift.io/v1 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 49f647918..41b1fc9a0 100644 --- a/script/test/fixtures/external-traffic-policy/output-os-v2.yaml +++ b/script/test/fixtures/external-traffic-policy/output-os-v2.yaml @@ -20,8 +20,7 @@ spec: selector: io.kompose.service: front-end type: ClusterIP -status: - loadBalancer: {} + --- apiVersion: apps.openshift.io/v1 diff --git a/script/test/fixtures/fsgroup/output-k8s.yaml b/script/test/fixtures/fsgroup/output-k8s.yaml index 51ad5d6d1..b2781e96d 100644 --- a/script/test/fixtures/fsgroup/output-k8s.yaml +++ b/script/test/fixtures/fsgroup/output-k8s.yaml @@ -43,7 +43,7 @@ spec: - name: pgadmin-data persistentVolumeClaim: claimName: pgadmin-data -status: {} + --- apiVersion: v1 @@ -59,4 +59,4 @@ spec: resources: requests: storage: 100Mi -status: {} + diff --git a/script/test/fixtures/fsgroup/output-os.yaml b/script/test/fixtures/fsgroup/output-os.yaml index acd7174c7..2e5cb4dd4 100644 --- a/script/test/fixtures/fsgroup/output-os.yaml +++ b/script/test/fixtures/fsgroup/output-os.yaml @@ -98,4 +98,4 @@ spec: resources: requests: storage: 100Mi -status: {} + diff --git a/script/test/fixtures/healthcheck/output-healthcheck-k8s.yaml b/script/test/fixtures/healthcheck/output-healthcheck-k8s.yaml index 9c8115a1a..7b187311b 100644 --- a/script/test/fixtures/healthcheck/output-healthcheck-k8s.yaml +++ b/script/test/fixtures/healthcheck/output-healthcheck-k8s.yaml @@ -20,8 +20,7 @@ spec: targetPort: 27017 selector: io.kompose.service: mongo -status: - loadBalancer: {} + --- apiVersion: v1 @@ -45,8 +44,7 @@ spec: targetPort: 3306 selector: io.kompose.service: mysql -status: - loadBalancer: {} + --- apiVersion: v1 @@ -71,8 +69,7 @@ spec: targetPort: 5432 selector: io.kompose.service: postgresql -status: - loadBalancer: {} + --- apiVersion: v1 @@ -94,8 +91,7 @@ spec: targetPort: 6379 selector: io.kompose.service: redis -status: - loadBalancer: {} + --- apiVersion: apps/v1 @@ -152,7 +148,7 @@ spec: timeoutSeconds: 1 resources: {} restartPolicy: Always -status: {} + --- apiVersion: apps/v1 @@ -209,7 +205,7 @@ spec: timeoutSeconds: 2 resources: {} restartPolicy: Always -status: {} + --- apiVersion: apps/v1 @@ -270,7 +266,7 @@ spec: timeoutSeconds: 1 resources: {} restartPolicy: Always -status: {} + --- apiVersion: apps/v1 @@ -326,5 +322,5 @@ spec: timeoutSeconds: 1 resources: {} restartPolicy: Always -status: {} + diff --git a/script/test/fixtures/healthcheck/output-healthcheck-os.yaml b/script/test/fixtures/healthcheck/output-healthcheck-os.yaml index a4a29a6b1..96b4d6fd9 100644 --- a/script/test/fixtures/healthcheck/output-healthcheck-os.yaml +++ b/script/test/fixtures/healthcheck/output-healthcheck-os.yaml @@ -20,8 +20,7 @@ spec: targetPort: 27017 selector: io.kompose.service: mongo -status: - loadBalancer: {} + --- apiVersion: v1 @@ -45,8 +44,7 @@ spec: targetPort: 3306 selector: io.kompose.service: mysql -status: - loadBalancer: {} + --- apiVersion: v1 @@ -71,8 +69,7 @@ spec: targetPort: 5432 selector: io.kompose.service: postgresql -status: - loadBalancer: {} + --- apiVersion: v1 @@ -94,8 +91,7 @@ spec: targetPort: 6379 selector: io.kompose.service: redis -status: - loadBalancer: {} + --- apiVersion: apps.openshift.io/v1 diff --git a/script/test/fixtures/host-port-protocol/output-k8s.yaml b/script/test/fixtures/host-port-protocol/output-k8s.yaml index 8af386f17..fe317969f 100644 --- a/script/test/fixtures/host-port-protocol/output-k8s.yaml +++ b/script/test/fixtures/host-port-protocol/output-k8s.yaml @@ -13,8 +13,7 @@ spec: targetPort: 80 selector: io.kompose.service: nginx -status: - loadBalancer: {} + --- apiVersion: apps/v1 @@ -46,5 +45,5 @@ spec: protocol: TCP resources: {} restartPolicy: Always -status: {} + diff --git a/script/test/fixtures/host-port-protocol/output-os.yaml b/script/test/fixtures/host-port-protocol/output-os.yaml index e16593732..9dc2f2ba5 100644 --- a/script/test/fixtures/host-port-protocol/output-os.yaml +++ b/script/test/fixtures/host-port-protocol/output-os.yaml @@ -13,8 +13,7 @@ spec: targetPort: 80 selector: io.kompose.service: nginx -status: - loadBalancer: {} + --- apiVersion: apps.openshift.io/v1 diff --git a/script/test/fixtures/multiple-files/output-k8s.yaml b/script/test/fixtures/multiple-files/output-k8s.yaml index 165a54c84..57ada9d43 100644 --- a/script/test/fixtures/multiple-files/output-k8s.yaml +++ b/script/test/fixtures/multiple-files/output-k8s.yaml @@ -24,7 +24,7 @@ spec: name: bar resources: {} restartPolicy: Always -status: {} + --- apiVersion: apps/v1 @@ -52,5 +52,5 @@ spec: name: foo resources: {} restartPolicy: Always -status: {} + diff --git a/script/test/fixtures/multiple-type-volumes/output-k8s.yaml b/script/test/fixtures/multiple-type-volumes/output-k8s.yaml index 40690d2a2..1e928200f 100644 --- a/script/test/fixtures/multiple-type-volumes/output-k8s.yaml +++ b/script/test/fixtures/multiple-type-volumes/output-k8s.yaml @@ -36,7 +36,7 @@ spec: - name: db-data persistentVolumeClaim: claimName: db-data -status: {} + --- apiVersion: v1 @@ -52,7 +52,7 @@ spec: resources: requests: storage: 100Mi -status: {} + --- apiVersion: apps/v1 @@ -101,7 +101,7 @@ spec: path: test-a-key.key name: web-cm1 name: web-cm1 -status: {} + --- apiVersion: v1 diff --git a/script/test/fixtures/multiple-type-volumes/output-os.yaml b/script/test/fixtures/multiple-type-volumes/output-os.yaml index 9a4c7b769..25673de9d 100644 --- a/script/test/fixtures/multiple-type-volumes/output-os.yaml +++ b/script/test/fixtures/multiple-type-volumes/output-os.yaml @@ -91,7 +91,7 @@ spec: resources: requests: storage: 100Mi -status: {} + --- apiVersion: apps.openshift.io/v1 diff --git a/script/test/fixtures/namespace/output-k8s.yaml b/script/test/fixtures/namespace/output-k8s.yaml index 5d262bfcf..fcb0e2322 100644 --- a/script/test/fixtures/namespace/output-k8s.yaml +++ b/script/test/fixtures/namespace/output-k8s.yaml @@ -14,8 +14,7 @@ spec: targetPort: 80 selector: io.kompose.service: web -status: - loadBalancer: {} + --- apiVersion: v1 @@ -25,7 +24,7 @@ metadata: name: web namespace: web spec: {} -status: {} + --- apiVersion: apps/v1 @@ -58,5 +57,5 @@ spec: protocol: TCP resources: {} restartPolicy: Always -status: {} + diff --git a/script/test/fixtures/namespace/output-os.yaml b/script/test/fixtures/namespace/output-os.yaml index 65c150733..e26e3c61a 100644 --- a/script/test/fixtures/namespace/output-os.yaml +++ b/script/test/fixtures/namespace/output-os.yaml @@ -14,8 +14,7 @@ spec: targetPort: 80 selector: io.kompose.service: web -status: - loadBalancer: {} + --- apiVersion: v1 @@ -25,7 +24,7 @@ metadata: name: web namespace: web spec: {} -status: {} + --- apiVersion: apps.openshift.io/v1 diff --git a/script/test/fixtures/network-policies/output-k8s.yaml b/script/test/fixtures/network-policies/output-k8s.yaml index 8dbca2cc4..80e96dbd4 100644 --- a/script/test/fixtures/network-policies/output-k8s.yaml +++ b/script/test/fixtures/network-policies/output-k8s.yaml @@ -13,8 +13,7 @@ spec: targetPort: 80 selector: io.kompose.service: nginx -status: - loadBalancer: {} + --- apiVersion: apps/v1 @@ -46,7 +45,7 @@ spec: protocol: TCP resources: {} restartPolicy: Always -status: {} + --- apiVersion: networking.k8s.io/v1 diff --git a/script/test/fixtures/read-only/output-k8s.yaml b/script/test/fixtures/read-only/output-k8s.yaml index d18582fde..70eb47d38 100644 --- a/script/test/fixtures/read-only/output-k8s.yaml +++ b/script/test/fixtures/read-only/output-k8s.yaml @@ -13,8 +13,7 @@ spec: targetPort: 80 selector: io.kompose.service: test -status: - loadBalancer: {} + --- apiVersion: apps/v1 @@ -48,5 +47,5 @@ spec: securityContext: readOnlyRootFilesystem: true restartPolicy: Always -status: {} + diff --git a/script/test/fixtures/read-only/output-os.yaml b/script/test/fixtures/read-only/output-os.yaml index 40cc310ed..c098ed199 100644 --- a/script/test/fixtures/read-only/output-os.yaml +++ b/script/test/fixtures/read-only/output-os.yaml @@ -13,8 +13,7 @@ spec: targetPort: 80 selector: io.kompose.service: test -status: - loadBalancer: {} + --- apiVersion: apps.openshift.io/v1 diff --git a/script/test/fixtures/service-group/output-k8s.yaml b/script/test/fixtures/service-group/output-k8s.yaml index 579296619..4d3a583dc 100644 --- a/script/test/fixtures/service-group/output-k8s.yaml +++ b/script/test/fixtures/service-group/output-k8s.yaml @@ -13,8 +13,7 @@ spec: targetPort: 8000 selector: io.kompose.service: librenms-dispatcher -status: - loadBalancer: {} + --- apiVersion: apps/v1 @@ -65,7 +64,7 @@ spec: - name: librenms-dispatcher-claim0 persistentVolumeClaim: claimName: librenms-dispatcher-claim0 -status: {} + --- apiVersion: v1 @@ -81,5 +80,5 @@ spec: resources: requests: storage: 100Mi -status: {} + diff --git a/script/test/fixtures/single-file-output/output-k8s.yaml b/script/test/fixtures/single-file-output/output-k8s.yaml index 39835492b..f38286339 100644 --- a/script/test/fixtures/single-file-output/output-k8s.yaml +++ b/script/test/fixtures/single-file-output/output-k8s.yaml @@ -16,8 +16,7 @@ spec: targetPort: 80 selector: io.kompose.service: front-end -status: - loadBalancer: {} + --- apiVersion: apps/v1 @@ -58,7 +57,7 @@ spec: protocol: TCP resources: {} restartPolicy: Always -status: {} + --- apiVersion: networking.k8s.io/v1 @@ -84,6 +83,5 @@ spec: number: 80 path: / pathType: Prefix -status: - loadBalancer: {} + diff --git a/script/test/fixtures/statefulset/output-k8s.yaml b/script/test/fixtures/statefulset/output-k8s.yaml index 7172545e1..6d773d95c 100644 --- a/script/test/fixtures/statefulset/output-k8s.yaml +++ b/script/test/fixtures/statefulset/output-k8s.yaml @@ -15,8 +15,7 @@ spec: selector: io.kompose.service: db type: ClusterIP -status: - loadBalancer: {} + --- apiVersion: v1 @@ -35,8 +34,7 @@ spec: selector: io.kompose.service: wordpress type: ClusterIP -status: - loadBalancer: {} + --- apiVersion: apps/v1 @@ -93,7 +91,7 @@ spec: resources: requests: storage: 100Mi - status: {} + status: availableReplicas: 0 replicas: 0 @@ -153,7 +151,7 @@ spec: resources: requests: storage: 100Mi - status: {} + status: availableReplicas: 0 replicas: 0 diff --git a/script/test/fixtures/statefulset/output-os.yaml b/script/test/fixtures/statefulset/output-os.yaml index b3664bd23..afc00e3ad 100644 --- a/script/test/fixtures/statefulset/output-os.yaml +++ b/script/test/fixtures/statefulset/output-os.yaml @@ -13,8 +13,7 @@ spec: targetPort: 3306 selector: io.kompose.service: db -status: - loadBalancer: {} + --- apiVersion: v1 @@ -31,8 +30,7 @@ spec: targetPort: 80 selector: io.kompose.service: wordpress -status: - loadBalancer: {} + --- apiVersion: apps/v1 @@ -89,7 +87,7 @@ spec: resources: requests: storage: 100Mi - status: {} + status: availableReplicas: 0 replicas: 0 @@ -235,7 +233,7 @@ spec: resources: requests: storage: 100Mi - status: {} + status: availableReplicas: 0 replicas: 0 diff --git a/script/test/fixtures/v2/output-k8s.yaml b/script/test/fixtures/v2/output-k8s.yaml index 714375d22..7bd479372 100644 --- a/script/test/fixtures/v2/output-k8s.yaml +++ b/script/test/fixtures/v2/output-k8s.yaml @@ -86,8 +86,6 @@ spec: targetPort: 5010 selector: io.kompose.service: foo -status: - loadBalancer: {} --- apiVersion: v1 @@ -107,8 +105,6 @@ spec: selector: io.kompose.service: redis type: LoadBalancer -status: - loadBalancer: {} --- apiVersion: v1 @@ -129,8 +125,6 @@ spec: selector: io.kompose.service: redis type: LoadBalancer -status: - loadBalancer: {} --- apiVersion: v1 @@ -232,7 +226,6 @@ spec: securityContext: supplementalGroups: - 1234 -status: {} --- apiVersion: apps/v1 @@ -272,5 +265,4 @@ spec: limits: memory: "10485760e3" restartPolicy: Always -status: {} diff --git a/script/test/fixtures/v2/output-os.yaml b/script/test/fixtures/v2/output-os.yaml index f9282d271..2b815a658 100644 --- a/script/test/fixtures/v2/output-os.yaml +++ b/script/test/fixtures/v2/output-os.yaml @@ -86,8 +86,7 @@ spec: targetPort: 5010 selector: io.kompose.service: foo -status: - loadBalancer: {} + --- apiVersion: v1 @@ -107,8 +106,7 @@ spec: selector: io.kompose.service: redis type: LoadBalancer -status: - loadBalancer: {} + --- apiVersion: v1 @@ -129,8 +127,7 @@ spec: selector: io.kompose.service: redis type: LoadBalancer -status: - loadBalancer: {} + --- apiVersion: v1 @@ -232,7 +229,7 @@ spec: securityContext: supplementalGroups: - 1234 -status: {} + --- apiVersion: apps.openshift.io/v1 diff --git a/script/test/fixtures/v3.0/output-k8s.yaml b/script/test/fixtures/v3.0/output-k8s.yaml index ae6ee9024..4dce1f1a3 100644 --- a/script/test/fixtures/v3.0/output-k8s.yaml +++ b/script/test/fixtures/v3.0/output-k8s.yaml @@ -16,8 +16,6 @@ spec: targetPort: 0 selector: io.kompose.service: redis -status: - loadBalancer: {} --- apiVersion: apps/v1 @@ -51,7 +49,6 @@ spec: name: foo resources: {} restartPolicy: Always -status: {} --- apiVersion: apps/v1 @@ -90,5 +87,4 @@ spec: name: redis resources: {} restartPolicy: Always -status: {} diff --git a/script/test/fixtures/v3.0/output-os.yaml b/script/test/fixtures/v3.0/output-os.yaml index 261177003..3b81d1ddf 100644 --- a/script/test/fixtures/v3.0/output-os.yaml +++ b/script/test/fixtures/v3.0/output-os.yaml @@ -16,8 +16,7 @@ spec: targetPort: 0 selector: io.kompose.service: redis -status: - loadBalancer: {} + --- apiVersion: apps.openshift.io/v1 diff --git a/script/test/fixtures/vols-subpath/output-k8s.yaml b/script/test/fixtures/vols-subpath/output-k8s.yaml index de17dc836..d090bd801 100644 --- a/script/test/fixtures/vols-subpath/output-k8s.yaml +++ b/script/test/fixtures/vols-subpath/output-k8s.yaml @@ -44,7 +44,7 @@ spec: - name: postgres-data persistentVolumeClaim: claimName: postgres-data -status: {} + --- apiVersion: v1 @@ -60,4 +60,4 @@ spec: resources: requests: storage: 100Mi -status: {} + diff --git a/script/test/fixtures/vols-subpath/output-os.yaml b/script/test/fixtures/vols-subpath/output-os.yaml index bd2295e3f..b0a5fa2bb 100644 --- a/script/test/fixtures/vols-subpath/output-os.yaml +++ b/script/test/fixtures/vols-subpath/output-os.yaml @@ -99,5 +99,5 @@ spec: resources: requests: storage: 100Mi -status: {} + diff --git a/script/test/fixtures/volume-mounts/windows/output-k8s.yaml b/script/test/fixtures/volume-mounts/windows/output-k8s.yaml index 29a2eb650..d5128c624 100644 --- a/script/test/fixtures/volume-mounts/windows/output-k8s.yaml +++ b/script/test/fixtures/volume-mounts/windows/output-k8s.yaml @@ -13,8 +13,6 @@ spec: targetPort: 80 selector: io.kompose.service: db -status: - loadBalancer: {} --- apiVersion: apps/v1 @@ -53,7 +51,6 @@ spec: - name: db-claim0 persistentVolumeClaim: claimName: db-claim0 -status: {} --- apiVersion: v1 @@ -69,5 +66,4 @@ spec: resources: requests: storage: 100Mi -status: {} diff --git a/script/test/fixtures/volume-mounts/windows/output-os.yaml b/script/test/fixtures/volume-mounts/windows/output-os.yaml index ac6b530ee..956ea0c5d 100644 --- a/script/test/fixtures/volume-mounts/windows/output-os.yaml +++ b/script/test/fixtures/volume-mounts/windows/output-os.yaml @@ -13,8 +13,7 @@ spec: targetPort: 80 selector: io.kompose.service: db -status: - loadBalancer: {} + --- apiVersion: apps.openshift.io/v1 @@ -110,5 +109,5 @@ spec: resources: requests: storage: 100Mi -status: {} + From 204dff4dab3534bf6a937fc10b863c78dac6f1be Mon Sep 17 00:00:00 2001 From: shubhindia Date: Mon, 30 Oct 2023 14:56:34 +0530 Subject: [PATCH 3/4] drop openshift status as well Signed-off-by: shubhindia --- .../output-os-empty-vols-template.yaml | 22 ++-------- .../fixtures/change-in-volume/output-os.yaml | 22 ++-------- .../configmap-volume/output-os-withlabel.yaml | 22 ++-------- .../fixtures/configmap-volume/output-os.yaml | 22 ++-------- .../deploy/placement/output-placement-os.yaml | 11 +---- .../test/fixtures/env-multiple/output-os.yaml | 22 ++-------- script/test/fixtures/env/output-os.yaml | 22 ++-------- .../envvars-interpolation/output-os.yaml | 11 +---- script/test/fixtures/expose/output-os.yaml | 24 ++-------- .../external-traffic-policy/output-os-v1.yaml | 11 +---- .../external-traffic-policy/output-os-v2.yaml | 13 +----- script/test/fixtures/fsgroup/output-os.yaml | 11 +---- .../healthcheck/output-healthcheck-os.yaml | 44 ++++--------------- .../host-port-protocol/output-os.yaml | 11 +---- .../fixtures/multiple-files/output-os.yaml | 22 ++-------- .../multiple-type-volumes/output-os.yaml | 22 ++-------- script/test/fixtures/namespace/output-os.yaml | 11 +---- script/test/fixtures/read-only/output-os.yaml | 11 +---- .../test/fixtures/statefulset/output-k8s.yaml | 8 ---- .../test/fixtures/statefulset/output-os.yaml | 30 ++----------- script/test/fixtures/v2/output-os.yaml | 11 +---- script/test/fixtures/v3.0/output-os.yaml | 22 ++-------- .../test/fixtures/vols-subpath/output-os.yaml | 11 +---- .../volume-mounts/windows/output-os.yaml | 11 +---- 24 files changed, 74 insertions(+), 353 deletions(-) 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 0db502c9b..9ebeb8e85 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 @@ -74,13 +74,7 @@ spec: kind: ImageStreamTag name: redis:latest type: ImageChange -status: - availableReplicas: 0 - latestVersion: 0 - observedGeneration: 0 - replicas: 0 - unavailableReplicas: 0 - updatedReplicas: 0 + --- apiVersion: image.openshift.io/v1 @@ -103,8 +97,7 @@ spec: name: latest referencePolicy: type: "" -status: - dockerImageRepository: "" + --- apiVersion: apps.openshift.io/v1 @@ -157,13 +150,7 @@ spec: kind: ImageStreamTag name: web:latest type: ImageChange -status: - availableReplicas: 0 - latestVersion: 0 - observedGeneration: 0 - replicas: 0 - unavailableReplicas: 0 - updatedReplicas: 0 + --- apiVersion: image.openshift.io/v1 @@ -186,6 +173,5 @@ spec: name: latest referencePolicy: type: "" -status: - dockerImageRepository: "" + diff --git a/script/test/fixtures/change-in-volume/output-os.yaml b/script/test/fixtures/change-in-volume/output-os.yaml index 0db502c9b..9ebeb8e85 100644 --- a/script/test/fixtures/change-in-volume/output-os.yaml +++ b/script/test/fixtures/change-in-volume/output-os.yaml @@ -74,13 +74,7 @@ spec: kind: ImageStreamTag name: redis:latest type: ImageChange -status: - availableReplicas: 0 - latestVersion: 0 - observedGeneration: 0 - replicas: 0 - unavailableReplicas: 0 - updatedReplicas: 0 + --- apiVersion: image.openshift.io/v1 @@ -103,8 +97,7 @@ spec: name: latest referencePolicy: type: "" -status: - dockerImageRepository: "" + --- apiVersion: apps.openshift.io/v1 @@ -157,13 +150,7 @@ spec: kind: ImageStreamTag name: web:latest type: ImageChange -status: - availableReplicas: 0 - latestVersion: 0 - observedGeneration: 0 - replicas: 0 - unavailableReplicas: 0 - updatedReplicas: 0 + --- apiVersion: image.openshift.io/v1 @@ -186,6 +173,5 @@ spec: name: latest referencePolicy: type: "" -status: - dockerImageRepository: "" + diff --git a/script/test/fixtures/configmap-volume/output-os-withlabel.yaml b/script/test/fixtures/configmap-volume/output-os-withlabel.yaml index 4ab7aa8ae..ec34dce71 100644 --- a/script/test/fixtures/configmap-volume/output-os-withlabel.yaml +++ b/script/test/fixtures/configmap-volume/output-os-withlabel.yaml @@ -49,13 +49,7 @@ spec: kind: ImageStreamTag name: db:latest type: ImageChange -status: - availableReplicas: 0 - latestVersion: 0 - observedGeneration: 0 - replicas: 0 - unavailableReplicas: 0 - updatedReplicas: 0 + --- apiVersion: image.openshift.io/v1 @@ -78,8 +72,7 @@ spec: name: latest referencePolicy: type: "" -status: - dockerImageRepository: "" + --- apiVersion: v1 @@ -150,13 +143,7 @@ spec: kind: ImageStreamTag name: web:latest type: ImageChange -status: - availableReplicas: 0 - latestVersion: 0 - observedGeneration: 0 - replicas: 0 - unavailableReplicas: 0 - updatedReplicas: 0 + --- apiVersion: image.openshift.io/v1 @@ -179,8 +166,7 @@ spec: name: latest referencePolicy: type: "" -status: - dockerImageRepository: "" + --- apiVersion: v1 diff --git a/script/test/fixtures/configmap-volume/output-os.yaml b/script/test/fixtures/configmap-volume/output-os.yaml index c1a9628e6..5a3a7d06b 100644 --- a/script/test/fixtures/configmap-volume/output-os.yaml +++ b/script/test/fixtures/configmap-volume/output-os.yaml @@ -47,13 +47,7 @@ spec: kind: ImageStreamTag name: db:latest type: ImageChange -status: - availableReplicas: 0 - latestVersion: 0 - observedGeneration: 0 - replicas: 0 - unavailableReplicas: 0 - updatedReplicas: 0 + --- apiVersion: image.openshift.io/v1 @@ -76,8 +70,7 @@ spec: name: latest referencePolicy: type: "" -status: - dockerImageRepository: "" + --- apiVersion: v1 @@ -146,13 +139,7 @@ spec: kind: ImageStreamTag name: web:latest type: ImageChange -status: - availableReplicas: 0 - latestVersion: 0 - observedGeneration: 0 - replicas: 0 - unavailableReplicas: 0 - updatedReplicas: 0 + --- apiVersion: image.openshift.io/v1 @@ -175,8 +162,7 @@ spec: name: latest referencePolicy: type: "" -status: - dockerImageRepository: "" + --- apiVersion: v1 diff --git a/script/test/fixtures/deploy/placement/output-placement-os.yaml b/script/test/fixtures/deploy/placement/output-placement-os.yaml index 87293e70a..13aa8541d 100644 --- a/script/test/fixtures/deploy/placement/output-placement-os.yaml +++ b/script/test/fixtures/deploy/placement/output-placement-os.yaml @@ -85,13 +85,7 @@ spec: kind: ImageStreamTag name: redis:latest type: ImageChange -status: - availableReplicas: 0 - latestVersion: 0 - observedGeneration: 0 - replicas: 0 - unavailableReplicas: 0 - updatedReplicas: 0 + --- apiVersion: image.openshift.io/v1 @@ -114,6 +108,5 @@ spec: name: latest referencePolicy: type: "" -status: - dockerImageRepository: "" + diff --git a/script/test/fixtures/env-multiple/output-os.yaml b/script/test/fixtures/env-multiple/output-os.yaml index 93f6d07b8..7559184ee 100644 --- a/script/test/fixtures/env-multiple/output-os.yaml +++ b/script/test/fixtures/env-multiple/output-os.yaml @@ -110,13 +110,7 @@ spec: kind: ImageStreamTag name: another-namenode:2.0.0-hadoop2.7.4-java8 type: ImageChange -status: - availableReplicas: 0 - latestVersion: 0 - observedGeneration: 0 - replicas: 0 - unavailableReplicas: 0 - updatedReplicas: 0 + --- apiVersion: image.openshift.io/v1 @@ -139,8 +133,7 @@ spec: name: 2.0.0-hadoop2.7.4-java8 referencePolicy: type: "" -status: - dockerImageRepository: "" + --- apiVersion: apps.openshift.io/v1 @@ -194,13 +187,7 @@ spec: kind: ImageStreamTag name: namenode:2.0.0-hadoop2.7.4-java8 type: ImageChange -status: - availableReplicas: 0 - latestVersion: 0 - observedGeneration: 0 - replicas: 0 - unavailableReplicas: 0 - updatedReplicas: 0 + --- apiVersion: image.openshift.io/v1 @@ -223,6 +210,5 @@ spec: name: 2.0.0-hadoop2.7.4-java8 referencePolicy: type: "" -status: - dockerImageRepository: "" + diff --git a/script/test/fixtures/env/output-os.yaml b/script/test/fixtures/env/output-os.yaml index da1c8d177..968e87bde 100644 --- a/script/test/fixtures/env/output-os.yaml +++ b/script/test/fixtures/env/output-os.yaml @@ -105,13 +105,7 @@ spec: kind: ImageStreamTag name: another-namenode:2.0.0-hadoop2.7.4-java8 type: ImageChange -status: - availableReplicas: 0 - latestVersion: 0 - observedGeneration: 0 - replicas: 0 - unavailableReplicas: 0 - updatedReplicas: 0 + --- apiVersion: image.openshift.io/v1 @@ -134,8 +128,7 @@ spec: name: 2.0.0-hadoop2.7.4-java8 referencePolicy: type: "" -status: - dockerImageRepository: "" + --- apiVersion: apps.openshift.io/v1 @@ -194,13 +187,7 @@ spec: kind: ImageStreamTag name: namenode:2.0.0-hadoop2.7.4-java8 type: ImageChange -status: - availableReplicas: 0 - latestVersion: 0 - observedGeneration: 0 - replicas: 0 - unavailableReplicas: 0 - updatedReplicas: 0 + --- apiVersion: image.openshift.io/v1 @@ -223,6 +210,5 @@ spec: name: 2.0.0-hadoop2.7.4-java8 referencePolicy: type: "" -status: - dockerImageRepository: "" + diff --git a/script/test/fixtures/envvars-interpolation/output-os.yaml b/script/test/fixtures/envvars-interpolation/output-os.yaml index f2113d65d..5a068904e 100644 --- a/script/test/fixtures/envvars-interpolation/output-os.yaml +++ b/script/test/fixtures/envvars-interpolation/output-os.yaml @@ -43,13 +43,7 @@ spec: kind: ImageStreamTag name: myservice:latest type: ImageChange -status: - availableReplicas: 0 - latestVersion: 0 - observedGeneration: 0 - replicas: 0 - unavailableReplicas: 0 - updatedReplicas: 0 + --- apiVersion: image.openshift.io/v1 @@ -72,6 +66,5 @@ spec: name: latest referencePolicy: type: "" -status: - dockerImageRepository: "" + diff --git a/script/test/fixtures/expose/output-os.yaml b/script/test/fixtures/expose/output-os.yaml index cfc61180d..d647dbcfa 100644 --- a/script/test/fixtures/expose/output-os.yaml +++ b/script/test/fixtures/expose/output-os.yaml @@ -76,13 +76,7 @@ spec: kind: ImageStreamTag name: redis:3.0 type: ImageChange -status: - availableReplicas: 0 - latestVersion: 0 - observedGeneration: 0 - replicas: 0 - unavailableReplicas: 0 - updatedReplicas: 0 + --- apiVersion: image.openshift.io/v1 @@ -105,8 +99,7 @@ spec: name: "3.0" referencePolicy: type: "" -status: - dockerImageRepository: "" + --- apiVersion: apps.openshift.io/v1 @@ -153,13 +146,7 @@ spec: kind: ImageStreamTag name: web:latest type: ImageChange -status: - availableReplicas: 0 - latestVersion: 0 - observedGeneration: 0 - replicas: 0 - unavailableReplicas: 0 - updatedReplicas: 0 + --- apiVersion: image.openshift.io/v1 @@ -182,8 +169,7 @@ spec: name: latest referencePolicy: type: "" -status: - dockerImageRepository: "" + --- apiVersion: v1 @@ -201,6 +187,4 @@ spec: kind: Service name: web weight: null -status: - ingress: null 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 a7958ccdb..5104183dd 100644 --- a/script/test/fixtures/external-traffic-policy/output-os-v1.yaml +++ b/script/test/fixtures/external-traffic-policy/output-os-v1.yaml @@ -71,13 +71,7 @@ spec: kind: ImageStreamTag name: front-end:v4 type: ImageChange -status: - availableReplicas: 0 - latestVersion: 0 - observedGeneration: 0 - replicas: 0 - unavailableReplicas: 0 - updatedReplicas: 0 + --- apiVersion: image.openshift.io/v1 @@ -100,6 +94,5 @@ spec: name: v4 referencePolicy: type: "" -status: - dockerImageRepository: "" + 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 41b1fc9a0..8dee1bf0f 100644 --- a/script/test/fixtures/external-traffic-policy/output-os-v2.yaml +++ b/script/test/fixtures/external-traffic-policy/output-os-v2.yaml @@ -71,13 +71,7 @@ spec: kind: ImageStreamTag name: front-end:v4 type: ImageChange -status: - availableReplicas: 0 - latestVersion: 0 - observedGeneration: 0 - replicas: 0 - unavailableReplicas: 0 - updatedReplicas: 0 + --- apiVersion: image.openshift.io/v1 @@ -100,8 +94,7 @@ spec: name: v4 referencePolicy: type: "" -status: - dockerImageRepository: "" + --- apiVersion: v1 @@ -119,6 +112,4 @@ spec: kind: Service name: front-end weight: null -status: - ingress: null diff --git a/script/test/fixtures/fsgroup/output-os.yaml b/script/test/fixtures/fsgroup/output-os.yaml index 2e5cb4dd4..dd4eb65c9 100644 --- a/script/test/fixtures/fsgroup/output-os.yaml +++ b/script/test/fixtures/fsgroup/output-os.yaml @@ -52,13 +52,7 @@ spec: kind: ImageStreamTag name: pgadmin:latest type: ImageChange -status: - availableReplicas: 0 - latestVersion: 0 - observedGeneration: 0 - replicas: 0 - unavailableReplicas: 0 - updatedReplicas: 0 + --- apiVersion: image.openshift.io/v1 @@ -81,8 +75,7 @@ spec: name: latest referencePolicy: type: "" -status: - dockerImageRepository: "" + --- apiVersion: v1 diff --git a/script/test/fixtures/healthcheck/output-healthcheck-os.yaml b/script/test/fixtures/healthcheck/output-healthcheck-os.yaml index 96b4d6fd9..bf29a66fe 100644 --- a/script/test/fixtures/healthcheck/output-healthcheck-os.yaml +++ b/script/test/fixtures/healthcheck/output-healthcheck-os.yaml @@ -152,13 +152,7 @@ spec: kind: ImageStreamTag name: mongo:latest type: ImageChange -status: - availableReplicas: 0 - latestVersion: 0 - observedGeneration: 0 - replicas: 0 - unavailableReplicas: 0 - updatedReplicas: 0 + --- apiVersion: image.openshift.io/v1 @@ -181,8 +175,7 @@ spec: name: latest referencePolicy: type: "" -status: - dockerImageRepository: "" + --- apiVersion: apps.openshift.io/v1 @@ -243,13 +236,7 @@ spec: kind: ImageStreamTag name: mysql:latest type: ImageChange -status: - availableReplicas: 0 - latestVersion: 0 - observedGeneration: 0 - replicas: 0 - unavailableReplicas: 0 - updatedReplicas: 0 + --- apiVersion: image.openshift.io/v1 @@ -272,8 +259,7 @@ spec: name: latest referencePolicy: type: "" -status: - dockerImageRepository: "" + --- apiVersion: apps.openshift.io/v1 @@ -337,13 +323,7 @@ spec: kind: ImageStreamTag name: postgresql:latest type: ImageChange -status: - availableReplicas: 0 - latestVersion: 0 - observedGeneration: 0 - replicas: 0 - unavailableReplicas: 0 - updatedReplicas: 0 + --- apiVersion: image.openshift.io/v1 @@ -366,8 +346,7 @@ spec: name: latest referencePolicy: type: "" -status: - dockerImageRepository: "" + --- apiVersion: apps.openshift.io/v1 @@ -429,13 +408,7 @@ spec: kind: ImageStreamTag name: redis:latest type: ImageChange -status: - availableReplicas: 0 - latestVersion: 0 - observedGeneration: 0 - replicas: 0 - unavailableReplicas: 0 - updatedReplicas: 0 + --- apiVersion: image.openshift.io/v1 @@ -458,6 +431,5 @@ spec: name: latest referencePolicy: type: "" -status: - dockerImageRepository: "" + diff --git a/script/test/fixtures/host-port-protocol/output-os.yaml b/script/test/fixtures/host-port-protocol/output-os.yaml index 9dc2f2ba5..a97f330cb 100644 --- a/script/test/fixtures/host-port-protocol/output-os.yaml +++ b/script/test/fixtures/host-port-protocol/output-os.yaml @@ -56,13 +56,7 @@ spec: kind: ImageStreamTag name: nginx:latest type: ImageChange -status: - availableReplicas: 0 - latestVersion: 0 - observedGeneration: 0 - replicas: 0 - unavailableReplicas: 0 - updatedReplicas: 0 + --- apiVersion: image.openshift.io/v1 @@ -85,6 +79,5 @@ spec: name: latest referencePolicy: type: "" -status: - dockerImageRepository: "" + diff --git a/script/test/fixtures/multiple-files/output-os.yaml b/script/test/fixtures/multiple-files/output-os.yaml index d673d0656..c9f1ab26e 100644 --- a/script/test/fixtures/multiple-files/output-os.yaml +++ b/script/test/fixtures/multiple-files/output-os.yaml @@ -35,13 +35,7 @@ spec: kind: ImageStreamTag name: bar:latest type: ImageChange -status: - availableReplicas: 0 - latestVersion: 0 - observedGeneration: 0 - replicas: 0 - unavailableReplicas: 0 - updatedReplicas: 0 + --- apiVersion: image.openshift.io/v1 @@ -64,8 +58,7 @@ spec: name: latest referencePolicy: type: "" -status: - dockerImageRepository: "" + --- apiVersion: apps.openshift.io/v1 @@ -104,13 +97,7 @@ spec: kind: ImageStreamTag name: foo:latest type: ImageChange -status: - availableReplicas: 0 - latestVersion: 0 - observedGeneration: 0 - replicas: 0 - unavailableReplicas: 0 - updatedReplicas: 0 + --- apiVersion: image.openshift.io/v1 @@ -133,6 +120,5 @@ spec: name: latest referencePolicy: type: "" -status: - dockerImageRepository: "" + diff --git a/script/test/fixtures/multiple-type-volumes/output-os.yaml b/script/test/fixtures/multiple-type-volumes/output-os.yaml index 25673de9d..0b076b184 100644 --- a/script/test/fixtures/multiple-type-volumes/output-os.yaml +++ b/script/test/fixtures/multiple-type-volumes/output-os.yaml @@ -45,13 +45,7 @@ spec: kind: ImageStreamTag name: db:latest type: ImageChange -status: - availableReplicas: 0 - latestVersion: 0 - observedGeneration: 0 - replicas: 0 - unavailableReplicas: 0 - updatedReplicas: 0 + --- apiVersion: image.openshift.io/v1 @@ -74,8 +68,7 @@ spec: name: latest referencePolicy: type: "" -status: - dockerImageRepository: "" + --- apiVersion: v1 @@ -149,13 +142,7 @@ spec: kind: ImageStreamTag name: web:latest type: ImageChange -status: - availableReplicas: 0 - latestVersion: 0 - observedGeneration: 0 - replicas: 0 - unavailableReplicas: 0 - updatedReplicas: 0 + --- apiVersion: image.openshift.io/v1 @@ -178,8 +165,7 @@ spec: name: latest referencePolicy: type: "" -status: - dockerImageRepository: "" + --- apiVersion: v1 diff --git a/script/test/fixtures/namespace/output-os.yaml b/script/test/fixtures/namespace/output-os.yaml index e26e3c61a..513e4f939 100644 --- a/script/test/fixtures/namespace/output-os.yaml +++ b/script/test/fixtures/namespace/output-os.yaml @@ -68,13 +68,7 @@ spec: kind: ImageStreamTag name: web:latest type: ImageChange -status: - availableReplicas: 0 - latestVersion: 0 - observedGeneration: 0 - replicas: 0 - unavailableReplicas: 0 - updatedReplicas: 0 + --- apiVersion: image.openshift.io/v1 @@ -98,6 +92,5 @@ spec: name: latest referencePolicy: type: "" -status: - dockerImageRepository: "" + diff --git a/script/test/fixtures/read-only/output-os.yaml b/script/test/fixtures/read-only/output-os.yaml index c098ed199..a33269ccc 100644 --- a/script/test/fixtures/read-only/output-os.yaml +++ b/script/test/fixtures/read-only/output-os.yaml @@ -58,13 +58,7 @@ spec: kind: ImageStreamTag name: test:latest type: ImageChange -status: - availableReplicas: 0 - latestVersion: 0 - observedGeneration: 0 - replicas: 0 - unavailableReplicas: 0 - updatedReplicas: 0 + --- apiVersion: image.openshift.io/v1 @@ -87,6 +81,5 @@ spec: name: latest referencePolicy: type: "" -status: - dockerImageRepository: "" + diff --git a/script/test/fixtures/statefulset/output-k8s.yaml b/script/test/fixtures/statefulset/output-k8s.yaml index 6d773d95c..a352dd74a 100644 --- a/script/test/fixtures/statefulset/output-k8s.yaml +++ b/script/test/fixtures/statefulset/output-k8s.yaml @@ -91,10 +91,6 @@ spec: resources: requests: storage: 100Mi - -status: - availableReplicas: 0 - replicas: 0 --- apiVersion: apps/v1 @@ -151,8 +147,4 @@ spec: resources: requests: storage: 100Mi - -status: - availableReplicas: 0 - replicas: 0 diff --git a/script/test/fixtures/statefulset/output-os.yaml b/script/test/fixtures/statefulset/output-os.yaml index afc00e3ad..8e84d895d 100644 --- a/script/test/fixtures/statefulset/output-os.yaml +++ b/script/test/fixtures/statefulset/output-os.yaml @@ -87,10 +87,6 @@ spec: resources: requests: storage: 100Mi - -status: - availableReplicas: 0 - replicas: 0 --- apiVersion: apps.openshift.io/v1 @@ -146,13 +142,7 @@ spec: kind: ImageStreamTag name: db:5.7 type: ImageChange -status: - availableReplicas: 0 - latestVersion: 0 - observedGeneration: 0 - replicas: 0 - unavailableReplicas: 0 - updatedReplicas: 0 + --- apiVersion: image.openshift.io/v1 @@ -175,8 +165,7 @@ spec: name: "5.7" referencePolicy: type: "" -status: - dockerImageRepository: "" + --- apiVersion: apps/v1 @@ -233,10 +222,6 @@ spec: resources: requests: storage: 100Mi - -status: - availableReplicas: 0 - replicas: 0 --- apiVersion: apps.openshift.io/v1 @@ -292,13 +277,7 @@ spec: kind: ImageStreamTag name: wordpress:latest type: ImageChange -status: - availableReplicas: 0 - latestVersion: 0 - observedGeneration: 0 - replicas: 0 - unavailableReplicas: 0 - updatedReplicas: 0 + --- apiVersion: image.openshift.io/v1 @@ -321,6 +300,5 @@ spec: name: latest referencePolicy: type: "" -status: - dockerImageRepository: "" + diff --git a/script/test/fixtures/v2/output-os.yaml b/script/test/fixtures/v2/output-os.yaml index 2b815a658..1fc525574 100644 --- a/script/test/fixtures/v2/output-os.yaml +++ b/script/test/fixtures/v2/output-os.yaml @@ -278,13 +278,7 @@ spec: kind: ImageStreamTag name: redis:3.0 type: ImageChange -status: - availableReplicas: 0 - latestVersion: 0 - observedGeneration: 0 - replicas: 0 - unavailableReplicas: 0 - updatedReplicas: 0 + --- apiVersion: image.openshift.io/v1 @@ -307,6 +301,5 @@ spec: name: "3.0" referencePolicy: type: "" -status: - dockerImageRepository: "" + diff --git a/script/test/fixtures/v3.0/output-os.yaml b/script/test/fixtures/v3.0/output-os.yaml index 3b81d1ddf..9fc4e07aa 100644 --- a/script/test/fixtures/v3.0/output-os.yaml +++ b/script/test/fixtures/v3.0/output-os.yaml @@ -61,13 +61,7 @@ spec: kind: ImageStreamTag name: foo:latest type: ImageChange -status: - availableReplicas: 0 - latestVersion: 0 - observedGeneration: 0 - replicas: 0 - unavailableReplicas: 0 - updatedReplicas: 0 + --- apiVersion: image.openshift.io/v1 @@ -90,8 +84,7 @@ spec: name: latest referencePolicy: type: "" -status: - dockerImageRepository: "" + --- apiVersion: apps.openshift.io/v1 @@ -139,13 +132,7 @@ spec: kind: ImageStreamTag name: redis:latest type: ImageChange -status: - availableReplicas: 0 - latestVersion: 0 - observedGeneration: 0 - replicas: 0 - unavailableReplicas: 0 - updatedReplicas: 0 + --- apiVersion: image.openshift.io/v1 @@ -168,6 +155,5 @@ spec: name: latest referencePolicy: type: "" -status: - dockerImageRepository: "" + diff --git a/script/test/fixtures/vols-subpath/output-os.yaml b/script/test/fixtures/vols-subpath/output-os.yaml index b0a5fa2bb..e49432139 100644 --- a/script/test/fixtures/vols-subpath/output-os.yaml +++ b/script/test/fixtures/vols-subpath/output-os.yaml @@ -53,13 +53,7 @@ spec: kind: ImageStreamTag name: postgres:latest type: ImageChange -status: - availableReplicas: 0 - latestVersion: 0 - observedGeneration: 0 - replicas: 0 - unavailableReplicas: 0 - updatedReplicas: 0 + --- apiVersion: image.openshift.io/v1 @@ -82,8 +76,7 @@ spec: name: latest referencePolicy: type: "" -status: - dockerImageRepository: "" + --- apiVersion: v1 diff --git a/script/test/fixtures/volume-mounts/windows/output-os.yaml b/script/test/fixtures/volume-mounts/windows/output-os.yaml index 956ea0c5d..b98e3a27b 100644 --- a/script/test/fixtures/volume-mounts/windows/output-os.yaml +++ b/script/test/fixtures/volume-mounts/windows/output-os.yaml @@ -63,13 +63,7 @@ spec: kind: ImageStreamTag name: db:latest type: ImageChange -status: - availableReplicas: 0 - latestVersion: 0 - observedGeneration: 0 - replicas: 0 - unavailableReplicas: 0 - updatedReplicas: 0 + --- apiVersion: image.openshift.io/v1 @@ -92,8 +86,7 @@ spec: name: latest referencePolicy: type: "" -status: - dockerImageRepository: "" + --- apiVersion: v1 From f5278904cc6041782cc32794f7368789590e3ceb Mon Sep 17 00:00:00 2001 From: shubhindia Date: Mon, 30 Oct 2023 19:59:26 +0530 Subject: [PATCH 4/4] mark regexp hack to be removed in future Signed-off-by: shubhindia --- pkg/transformer/utils.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/transformer/utils.go b/pkg/transformer/utils.go index f78c3deea..6b71de16e 100644 --- a/pkg/transformer/utils.go +++ b/pkg/transformer/utils.go @@ -275,7 +275,7 @@ func ConfigAnnotations(service kobject.ServiceConfig) map[string]string { // Print either prints to stdout or to file/s func Print(name, path string, trailing string, data []byte, toStdout, generateJSON bool, f *os.File, provider string) (string, error) { file := "" - // simple hack to remove status from the output + // TODO: we should refactor / change this hack in the future once we have a better solution re := regexp.MustCompile(`(?s)status:.*`) data = re.ReplaceAll(data, nil)