diff --git a/pkg/transformer/utils.go b/pkg/transformer/utils.go index 6b71de16e..3a3cc1078 100644 --- a/pkg/transformer/utils.go +++ b/pkg/transformer/utils.go @@ -248,14 +248,15 @@ func ConfigAllLabels(name string, service *kobject.ServiceConfig) map[string]str // ConfigAnnotations configures annotations func ConfigAnnotations(service kobject.ServiceConfig) map[string]string { annotations := map[string]string{} - for key, value := range service.Annotations { - annotations[key] = value - } if !service.WithKomposeAnnotation { return annotations } + for key, value := range service.Annotations { + annotations[key] = value + } + annotations["kompose.cmd"] = strings.Join(os.Args, " ") versionCmd := exec.Command("kompose", "version") out, err := versionCmd.Output() 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 13cdc7115..fc8b365ba 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 @@ -2,8 +2,6 @@ apiVersion: v1 kind: Service metadata: - annotations: - kompose.service.type: headless creationTimestamp: null labels: io.kompose.service: redis @@ -17,7 +15,6 @@ spec: selector: io.kompose.service: redis - --- apiVersion: v1 kind: Service @@ -34,13 +31,10 @@ spec: selector: io.kompose.service: web - --- apiVersion: apps/v1 kind: Deployment metadata: - annotations: - kompose.service.type: headless creationTimestamp: null labels: io.kompose.service: redis @@ -53,8 +47,6 @@ spec: strategy: {} template: metadata: - annotations: - kompose.service.type: headless creationTimestamp: null labels: io.kompose.network/change-in-volume-default: "true" @@ -66,7 +58,6 @@ spec: resources: {} restartPolicy: Always - --- apiVersion: apps/v1 kind: Deployment @@ -108,4 +99,3 @@ spec: - emptyDir: {} name: code-volume - diff --git a/script/test/fixtures/change-in-volume/output-k8s.yaml b/script/test/fixtures/change-in-volume/output-k8s.yaml index 13cdc7115..fc8b365ba 100644 --- a/script/test/fixtures/change-in-volume/output-k8s.yaml +++ b/script/test/fixtures/change-in-volume/output-k8s.yaml @@ -2,8 +2,6 @@ apiVersion: v1 kind: Service metadata: - annotations: - kompose.service.type: headless creationTimestamp: null labels: io.kompose.service: redis @@ -17,7 +15,6 @@ spec: selector: io.kompose.service: redis - --- apiVersion: v1 kind: Service @@ -34,13 +31,10 @@ spec: selector: io.kompose.service: web - --- apiVersion: apps/v1 kind: Deployment metadata: - annotations: - kompose.service.type: headless creationTimestamp: null labels: io.kompose.service: redis @@ -53,8 +47,6 @@ spec: strategy: {} template: metadata: - annotations: - kompose.service.type: headless creationTimestamp: null labels: io.kompose.network/change-in-volume-default: "true" @@ -66,7 +58,6 @@ spec: resources: {} restartPolicy: Always - --- apiVersion: apps/v1 kind: Deployment @@ -108,4 +99,3 @@ spec: - emptyDir: {} name: code-volume - 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 9ebeb8e85..e852c400d 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 @@ -2,8 +2,6 @@ apiVersion: v1 kind: Service metadata: - annotations: - kompose.service.type: headless creationTimestamp: null labels: io.kompose.service: redis @@ -17,7 +15,6 @@ spec: selector: io.kompose.service: redis - --- apiVersion: v1 kind: Service @@ -34,13 +31,10 @@ spec: selector: io.kompose.service: web - --- apiVersion: apps.openshift.io/v1 kind: DeploymentConfig metadata: - annotations: - kompose.service.type: headless creationTimestamp: null labels: io.kompose.service: redis @@ -75,7 +69,6 @@ spec: name: redis:latest type: ImageChange - --- apiVersion: image.openshift.io/v1 kind: ImageStream @@ -98,7 +91,6 @@ spec: referencePolicy: type: "" - --- apiVersion: apps.openshift.io/v1 kind: DeploymentConfig @@ -151,7 +143,6 @@ spec: name: web:latest type: ImageChange - --- apiVersion: image.openshift.io/v1 kind: ImageStream @@ -174,4 +165,3 @@ spec: referencePolicy: type: "" - diff --git a/script/test/fixtures/change-in-volume/output-os.yaml b/script/test/fixtures/change-in-volume/output-os.yaml index 9ebeb8e85..e852c400d 100644 --- a/script/test/fixtures/change-in-volume/output-os.yaml +++ b/script/test/fixtures/change-in-volume/output-os.yaml @@ -2,8 +2,6 @@ apiVersion: v1 kind: Service metadata: - annotations: - kompose.service.type: headless creationTimestamp: null labels: io.kompose.service: redis @@ -17,7 +15,6 @@ spec: selector: io.kompose.service: redis - --- apiVersion: v1 kind: Service @@ -34,13 +31,10 @@ spec: selector: io.kompose.service: web - --- apiVersion: apps.openshift.io/v1 kind: DeploymentConfig metadata: - annotations: - kompose.service.type: headless creationTimestamp: null labels: io.kompose.service: redis @@ -75,7 +69,6 @@ spec: name: redis:latest type: ImageChange - --- apiVersion: image.openshift.io/v1 kind: ImageStream @@ -98,7 +91,6 @@ spec: referencePolicy: type: "" - --- apiVersion: apps.openshift.io/v1 kind: DeploymentConfig @@ -151,7 +143,6 @@ spec: name: web:latest type: ImageChange - --- apiVersion: image.openshift.io/v1 kind: ImageStream @@ -174,4 +165,3 @@ spec: referencePolicy: type: "" - diff --git a/script/test/fixtures/compose-env-interpolation/output-k8s.yaml b/script/test/fixtures/compose-env-interpolation/output-k8s.yaml index f1a33b5a8..7e9a722ce 100644 --- a/script/test/fixtures/compose-env-interpolation/output-k8s.yaml +++ b/script/test/fixtures/compose-env-interpolation/output-k8s.yaml @@ -2,8 +2,6 @@ apiVersion: v1 kind: Service metadata: - annotations: - kompose.image-pull-policy: IfNotPresent creationTimestamp: null labels: io.kompose.service: foo @@ -16,13 +14,10 @@ spec: selector: io.kompose.service: foo - --- apiVersion: apps/v1 kind: Deployment metadata: - annotations: - kompose.image-pull-policy: IfNotPresent creationTimestamp: null labels: io.kompose.service: foo @@ -35,8 +30,6 @@ spec: strategy: {} template: metadata: - annotations: - kompose.image-pull-policy: IfNotPresent creationTimestamp: null labels: io.kompose.network/compose-env-interpolation-default: "true" @@ -53,4 +46,3 @@ spec: resources: {} restartPolicy: Always - diff --git a/script/test/fixtures/configmap-volume/output-k8s-withlabel.yaml b/script/test/fixtures/configmap-volume/output-k8s-withlabel.yaml index cbc4f995a..d59f0c30b 100644 --- a/script/test/fixtures/configmap-volume/output-k8s-withlabel.yaml +++ b/script/test/fixtures/configmap-volume/output-k8s-withlabel.yaml @@ -2,8 +2,6 @@ apiVersion: apps/v1 kind: Deployment metadata: - annotations: - kompose.volume.type: configMap creationTimestamp: null labels: io.kompose.service: db @@ -17,8 +15,6 @@ spec: type: Recreate template: metadata: - annotations: - kompose.volume.type: configMap creationTimestamp: null labels: io.kompose.network/configmap-volume-default: "true" @@ -41,7 +37,6 @@ spec: name: db-cm0 name: db-cm0 - --- apiVersion: v1 binaryData: @@ -59,8 +54,6 @@ metadata: apiVersion: apps/v1 kind: Deployment metadata: - annotations: - kompose.volume.type: configMap creationTimestamp: null labels: io.kompose.service: web @@ -74,8 +67,6 @@ spec: type: Recreate template: metadata: - annotations: - kompose.volume.type: configMap creationTimestamp: null labels: io.kompose.network/configmap-volume-default: "true" @@ -103,7 +94,6 @@ spec: name: web-cm1 name: web-cm1 - --- apiVersion: v1 data: diff --git a/script/test/fixtures/configmap-volume/output-os-withlabel.yaml b/script/test/fixtures/configmap-volume/output-os-withlabel.yaml index ec34dce71..b83752be4 100644 --- a/script/test/fixtures/configmap-volume/output-os-withlabel.yaml +++ b/script/test/fixtures/configmap-volume/output-os-withlabel.yaml @@ -2,8 +2,6 @@ apiVersion: apps.openshift.io/v1 kind: DeploymentConfig metadata: - annotations: - kompose.volume.type: configMap creationTimestamp: null labels: io.kompose.service: db @@ -50,7 +48,6 @@ spec: name: db:latest type: ImageChange - --- apiVersion: image.openshift.io/v1 kind: ImageStream @@ -73,7 +70,6 @@ spec: referencePolicy: type: "" - --- apiVersion: v1 binaryData: @@ -91,8 +87,6 @@ metadata: apiVersion: apps.openshift.io/v1 kind: DeploymentConfig metadata: - annotations: - kompose.volume.type: configMap creationTimestamp: null labels: io.kompose.service: web @@ -144,7 +138,6 @@ spec: name: web:latest type: ImageChange - --- apiVersion: image.openshift.io/v1 kind: ImageStream @@ -167,7 +160,6 @@ spec: referencePolicy: type: "" - --- apiVersion: v1 data: diff --git a/script/test/fixtures/expose/output-k8s.yaml b/script/test/fixtures/expose/output-k8s.yaml index 4688b43b7..d56175f8f 100644 --- a/script/test/fixtures/expose/output-k8s.yaml +++ b/script/test/fixtures/expose/output-k8s.yaml @@ -14,15 +14,10 @@ spec: selector: io.kompose.service: redis - --- apiVersion: v1 kind: Service metadata: - annotations: - kompose.service.expose: batman.example.com/dev,batwoman.example.com - kompose.service.expose.ingress-class-name: nginx - kompose.service.expose.tls-secret: test-secret creationTimestamp: null labels: io.kompose.service: web @@ -35,7 +30,6 @@ spec: selector: io.kompose.service: web - --- apiVersion: apps/v1 kind: Deployment @@ -66,15 +60,10 @@ spec: resources: {} restartPolicy: Always - --- apiVersion: apps/v1 kind: Deployment metadata: - annotations: - kompose.service.expose: batman.example.com/dev,batwoman.example.com - kompose.service.expose.ingress-class-name: nginx - kompose.service.expose.tls-secret: test-secret creationTimestamp: null labels: io.kompose.service: web @@ -87,10 +76,6 @@ spec: strategy: {} template: metadata: - annotations: - kompose.service.expose: batman.example.com/dev,batwoman.example.com - kompose.service.expose.ingress-class-name: nginx - kompose.service.expose.tls-secret: test-secret creationTimestamp: null labels: io.kompose.network/expose-default: "true" @@ -106,15 +91,10 @@ spec: resources: {} restartPolicy: Always - --- apiVersion: networking.k8s.io/v1 kind: Ingress metadata: - annotations: - kompose.service.expose: batman.example.com/dev,batwoman.example.com - kompose.service.expose.ingress-class-name: nginx - kompose.service.expose.tls-secret: test-secret creationTimestamp: null labels: io.kompose.service: web @@ -148,4 +128,3 @@ spec: - batwoman.example.com secretName: test-secret - diff --git a/script/test/fixtures/expose/output-os.yaml b/script/test/fixtures/expose/output-os.yaml index d647dbcfa..7ae6deabb 100644 --- a/script/test/fixtures/expose/output-os.yaml +++ b/script/test/fixtures/expose/output-os.yaml @@ -14,15 +14,10 @@ spec: selector: io.kompose.service: redis - --- apiVersion: v1 kind: Service metadata: - annotations: - kompose.service.expose: batman.example.com/dev,batwoman.example.com - kompose.service.expose.ingress-class-name: nginx - kompose.service.expose.tls-secret: test-secret creationTimestamp: null labels: io.kompose.service: web @@ -35,7 +30,6 @@ spec: selector: io.kompose.service: web - --- apiVersion: apps.openshift.io/v1 kind: DeploymentConfig @@ -77,7 +71,6 @@ spec: name: redis:3.0 type: ImageChange - --- apiVersion: image.openshift.io/v1 kind: ImageStream @@ -100,15 +93,10 @@ spec: referencePolicy: type: "" - --- apiVersion: apps.openshift.io/v1 kind: DeploymentConfig metadata: - annotations: - kompose.service.expose: batman.example.com/dev,batwoman.example.com - kompose.service.expose.ingress-class-name: nginx - kompose.service.expose.tls-secret: test-secret creationTimestamp: null labels: io.kompose.service: web @@ -147,7 +135,6 @@ spec: name: web:latest type: ImageChange - --- apiVersion: image.openshift.io/v1 kind: ImageStream @@ -170,7 +157,6 @@ spec: referencePolicy: type: "" - --- apiVersion: v1 kind: Route 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 180fa5332..0e09ca5d2 100644 --- a/script/test/fixtures/external-traffic-policy/output-k8s-v1.yaml +++ b/script/test/fixtures/external-traffic-policy/output-k8s-v1.yaml @@ -2,11 +2,6 @@ apiVersion: v1 kind: Service metadata: - annotations: - kompose.service.expose: lb - kompose.service.expose.ingress-class-name: nginx - kompose.service.external-traffic-policy: local - kompose.service.type: loadbalancer creationTimestamp: null labels: io.kompose.service: front-end-tcp @@ -21,16 +16,10 @@ spec: io.kompose.service: front-end type: LoadBalancer - --- apiVersion: apps/v1 kind: Deployment metadata: - annotations: - kompose.service.expose: lb - kompose.service.expose.ingress-class-name: nginx - kompose.service.external-traffic-policy: local - kompose.service.type: loadbalancer creationTimestamp: null labels: io.kompose.service: front-end @@ -43,11 +32,6 @@ spec: strategy: {} template: metadata: - annotations: - kompose.service.expose: lb - kompose.service.expose.ingress-class-name: nginx - kompose.service.external-traffic-policy: local - kompose.service.type: loadbalancer creationTimestamp: null labels: io.kompose.network/external-traffic-policy-default: "true" @@ -66,4 +50,3 @@ spec: resources: {} restartPolicy: Always - 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 97a530b51..4b678bf9e 100644 --- a/script/test/fixtures/external-traffic-policy/output-k8s-v2.yaml +++ b/script/test/fixtures/external-traffic-policy/output-k8s-v2.yaml @@ -2,11 +2,6 @@ apiVersion: v1 kind: Service metadata: - annotations: - kompose.service.expose: lb - kompose.service.expose.ingress-class-name: nginx - kompose.service.external-traffic-policy: local - kompose.service.type: headless creationTimestamp: null labels: io.kompose.service: front-end @@ -21,16 +16,10 @@ spec: io.kompose.service: front-end type: ClusterIP - --- apiVersion: apps/v1 kind: Deployment metadata: - annotations: - kompose.service.expose: lb - kompose.service.expose.ingress-class-name: nginx - kompose.service.external-traffic-policy: local - kompose.service.type: headless creationTimestamp: null labels: io.kompose.service: front-end @@ -43,11 +32,6 @@ spec: strategy: {} template: metadata: - annotations: - kompose.service.expose: lb - kompose.service.expose.ingress-class-name: nginx - kompose.service.external-traffic-policy: local - kompose.service.type: headless creationTimestamp: null labels: io.kompose.network/external-traffic-policy-default: "true" @@ -66,16 +50,10 @@ spec: resources: {} restartPolicy: Always - --- apiVersion: networking.k8s.io/v1 kind: Ingress metadata: - annotations: - kompose.service.expose: lb - kompose.service.expose.ingress-class-name: nginx - kompose.service.external-traffic-policy: local - kompose.service.type: headless creationTimestamp: null labels: io.kompose.service: front-end @@ -94,4 +72,3 @@ spec: path: / pathType: Prefix - 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 5104183dd..592632a9a 100644 --- a/script/test/fixtures/external-traffic-policy/output-os-v1.yaml +++ b/script/test/fixtures/external-traffic-policy/output-os-v1.yaml @@ -2,11 +2,6 @@ apiVersion: v1 kind: Service metadata: - annotations: - kompose.service.expose: lb - kompose.service.expose.ingress-class-name: nginx - kompose.service.external-traffic-policy: local - kompose.service.type: loadbalancer creationTimestamp: null labels: io.kompose.service: front-end-tcp @@ -21,16 +16,10 @@ spec: io.kompose.service: front-end type: LoadBalancer - --- apiVersion: apps.openshift.io/v1 kind: DeploymentConfig metadata: - annotations: - kompose.service.expose: lb - kompose.service.expose.ingress-class-name: nginx - kompose.service.external-traffic-policy: local - kompose.service.type: loadbalancer creationTimestamp: null labels: io.kompose.service: front-end @@ -72,7 +61,6 @@ spec: name: front-end:v4 type: ImageChange - --- apiVersion: image.openshift.io/v1 kind: ImageStream @@ -95,4 +83,3 @@ spec: referencePolicy: type: "" - 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 8dee1bf0f..63267a5d8 100644 --- a/script/test/fixtures/external-traffic-policy/output-os-v2.yaml +++ b/script/test/fixtures/external-traffic-policy/output-os-v2.yaml @@ -2,11 +2,6 @@ apiVersion: v1 kind: Service metadata: - annotations: - kompose.service.expose: lb - kompose.service.expose.ingress-class-name: nginx - kompose.service.external-traffic-policy: local - kompose.service.type: headless creationTimestamp: null labels: io.kompose.service: front-end @@ -21,16 +16,10 @@ spec: io.kompose.service: front-end type: ClusterIP - --- apiVersion: apps.openshift.io/v1 kind: DeploymentConfig metadata: - annotations: - kompose.service.expose: lb - kompose.service.expose.ingress-class-name: nginx - kompose.service.external-traffic-policy: local - kompose.service.type: headless creationTimestamp: null labels: io.kompose.service: front-end @@ -72,7 +61,6 @@ spec: name: front-end:v4 type: ImageChange - --- apiVersion: image.openshift.io/v1 kind: ImageStream @@ -95,7 +83,6 @@ spec: referencePolicy: type: "" - --- apiVersion: v1 kind: Route diff --git a/script/test/fixtures/fsgroup/output-k8s.yaml b/script/test/fixtures/fsgroup/output-k8s.yaml index b2781e96d..4113ff7aa 100644 --- a/script/test/fixtures/fsgroup/output-k8s.yaml +++ b/script/test/fixtures/fsgroup/output-k8s.yaml @@ -2,8 +2,6 @@ apiVersion: apps/v1 kind: Deployment metadata: - annotations: - kompose.security-context.fsgroup: "1001" creationTimestamp: null labels: io.kompose.service: pgadmin @@ -17,8 +15,6 @@ spec: type: Recreate template: metadata: - annotations: - kompose.security-context.fsgroup: "1001" creationTimestamp: null labels: io.kompose.network/fsgroup-default: "true" @@ -44,7 +40,6 @@ spec: persistentVolumeClaim: claimName: pgadmin-data - --- apiVersion: v1 kind: PersistentVolumeClaim diff --git a/script/test/fixtures/fsgroup/output-os.yaml b/script/test/fixtures/fsgroup/output-os.yaml index dd4eb65c9..74f3a2a69 100644 --- a/script/test/fixtures/fsgroup/output-os.yaml +++ b/script/test/fixtures/fsgroup/output-os.yaml @@ -2,8 +2,6 @@ apiVersion: apps.openshift.io/v1 kind: DeploymentConfig metadata: - annotations: - kompose.security-context.fsgroup: "1001" creationTimestamp: null labels: io.kompose.service: pgadmin @@ -53,7 +51,6 @@ spec: name: pgadmin:latest type: ImageChange - --- apiVersion: image.openshift.io/v1 kind: ImageStream @@ -76,7 +73,6 @@ spec: referencePolicy: type: "" - --- apiVersion: v1 kind: PersistentVolumeClaim diff --git a/script/test/fixtures/healthcheck/output-healthcheck-k8s.yaml b/script/test/fixtures/healthcheck/output-healthcheck-k8s.yaml index 7b187311b..71a3ca7c2 100644 --- a/script/test/fixtures/healthcheck/output-healthcheck-k8s.yaml +++ b/script/test/fixtures/healthcheck/output-healthcheck-k8s.yaml @@ -2,13 +2,6 @@ apiVersion: v1 kind: Service metadata: - annotations: - kompose.service.group: my-group - kompose.service.healthcheck.liveness.tcp_port: "8080" - kompose.service.healthcheck.readiness.interval: 10s - kompose.service.healthcheck.readiness.retries: "5" - kompose.service.healthcheck.readiness.tcp_port: "9090" - kompose.service.healthcheck.readiness.timeout: 1s creationTimestamp: null labels: io.kompose.service: mongo @@ -21,18 +14,10 @@ spec: selector: io.kompose.service: mongo - --- apiVersion: v1 kind: Service metadata: - annotations: - kompose.service.group: my-group - kompose.service.healthcheck.liveness.tcp_port: "8081" - kompose.service.healthcheck.readiness.interval: 11s - kompose.service.healthcheck.readiness.retries: "6" - kompose.service.healthcheck.readiness.tcp_port: "9091" - kompose.service.healthcheck.readiness.timeout: 2s creationTimestamp: null labels: io.kompose.service: mysql @@ -45,19 +30,10 @@ spec: selector: io.kompose.service: mysql - --- apiVersion: v1 kind: Service metadata: - annotations: - kompose.service.healthcheck.liveness.http_get_path: /health - kompose.service.healthcheck.liveness.http_get_port: "8080" - kompose.service.healthcheck.readiness.http_get_path: /ready - kompose.service.healthcheck.readiness.http_get_port: "8080" - kompose.service.healthcheck.readiness.interval: 10s - kompose.service.healthcheck.readiness.retries: "5" - kompose.service.healthcheck.readiness.timeout: 1s creationTimestamp: null labels: io.kompose.service: postgresql @@ -70,16 +46,10 @@ spec: selector: io.kompose.service: postgresql - --- apiVersion: v1 kind: Service metadata: - annotations: - kompose.service.healthcheck.readiness.interval: 10s - kompose.service.healthcheck.readiness.retries: "5" - kompose.service.healthcheck.readiness.test: echo "liveness" - kompose.service.healthcheck.readiness.timeout: 1s creationTimestamp: null labels: io.kompose.service: redis @@ -92,18 +62,10 @@ spec: selector: io.kompose.service: redis - --- apiVersion: apps/v1 kind: Deployment metadata: - annotations: - kompose.service.group: my-group - kompose.service.healthcheck.liveness.tcp_port: "8080" - kompose.service.healthcheck.readiness.interval: 10s - kompose.service.healthcheck.readiness.retries: "5" - kompose.service.healthcheck.readiness.tcp_port: "9090" - kompose.service.healthcheck.readiness.timeout: 1s creationTimestamp: null labels: io.kompose.service: mongo @@ -116,13 +78,6 @@ spec: strategy: {} template: metadata: - annotations: - kompose.service.group: my-group - kompose.service.healthcheck.liveness.tcp_port: "8080" - kompose.service.healthcheck.readiness.interval: 10s - kompose.service.healthcheck.readiness.retries: "5" - kompose.service.healthcheck.readiness.tcp_port: "9090" - kompose.service.healthcheck.readiness.timeout: 1s creationTimestamp: null labels: io.kompose.network/healthcheck-default: "true" @@ -149,18 +104,10 @@ spec: resources: {} restartPolicy: Always - --- apiVersion: apps/v1 kind: Deployment metadata: - annotations: - kompose.service.group: my-group - kompose.service.healthcheck.liveness.tcp_port: "8081" - kompose.service.healthcheck.readiness.interval: 11s - kompose.service.healthcheck.readiness.retries: "6" - kompose.service.healthcheck.readiness.tcp_port: "9091" - kompose.service.healthcheck.readiness.timeout: 2s creationTimestamp: null labels: io.kompose.service: mysql @@ -173,13 +120,6 @@ spec: strategy: {} template: metadata: - annotations: - kompose.service.group: my-group - kompose.service.healthcheck.liveness.tcp_port: "8081" - kompose.service.healthcheck.readiness.interval: 11s - kompose.service.healthcheck.readiness.retries: "6" - kompose.service.healthcheck.readiness.tcp_port: "9091" - kompose.service.healthcheck.readiness.timeout: 2s creationTimestamp: null labels: io.kompose.network/healthcheck-default: "true" @@ -206,19 +146,10 @@ spec: resources: {} restartPolicy: Always - --- apiVersion: apps/v1 kind: Deployment metadata: - annotations: - kompose.service.healthcheck.liveness.http_get_path: /health - kompose.service.healthcheck.liveness.http_get_port: "8080" - kompose.service.healthcheck.readiness.http_get_path: /ready - kompose.service.healthcheck.readiness.http_get_port: "8080" - kompose.service.healthcheck.readiness.interval: 10s - kompose.service.healthcheck.readiness.retries: "5" - kompose.service.healthcheck.readiness.timeout: 1s creationTimestamp: null labels: io.kompose.service: postgresql @@ -231,14 +162,6 @@ spec: strategy: {} template: metadata: - annotations: - kompose.service.healthcheck.liveness.http_get_path: /health - kompose.service.healthcheck.liveness.http_get_port: "8080" - kompose.service.healthcheck.readiness.http_get_path: /ready - kompose.service.healthcheck.readiness.http_get_port: "8080" - kompose.service.healthcheck.readiness.interval: 10s - kompose.service.healthcheck.readiness.retries: "5" - kompose.service.healthcheck.readiness.timeout: 1s creationTimestamp: null labels: io.kompose.network/healthcheck-default: "true" @@ -267,16 +190,10 @@ spec: resources: {} restartPolicy: Always - --- apiVersion: apps/v1 kind: Deployment metadata: - annotations: - kompose.service.healthcheck.readiness.interval: 10s - kompose.service.healthcheck.readiness.retries: "5" - kompose.service.healthcheck.readiness.test: echo "liveness" - kompose.service.healthcheck.readiness.timeout: 1s creationTimestamp: null labels: io.kompose.service: redis @@ -289,11 +206,6 @@ spec: strategy: {} template: metadata: - annotations: - kompose.service.healthcheck.readiness.interval: 10s - kompose.service.healthcheck.readiness.retries: "5" - kompose.service.healthcheck.readiness.test: echo "liveness" - kompose.service.healthcheck.readiness.timeout: 1s creationTimestamp: null labels: io.kompose.network/healthcheck-default: "true" @@ -323,4 +235,3 @@ spec: resources: {} restartPolicy: Always - diff --git a/script/test/fixtures/healthcheck/output-healthcheck-os.yaml b/script/test/fixtures/healthcheck/output-healthcheck-os.yaml index bf29a66fe..7033747cf 100644 --- a/script/test/fixtures/healthcheck/output-healthcheck-os.yaml +++ b/script/test/fixtures/healthcheck/output-healthcheck-os.yaml @@ -2,13 +2,6 @@ apiVersion: v1 kind: Service metadata: - annotations: - kompose.service.group: my-group - kompose.service.healthcheck.liveness.tcp_port: "8080" - kompose.service.healthcheck.readiness.interval: 10s - kompose.service.healthcheck.readiness.retries: "5" - kompose.service.healthcheck.readiness.tcp_port: "9090" - kompose.service.healthcheck.readiness.timeout: 1s creationTimestamp: null labels: io.kompose.service: mongo @@ -21,18 +14,10 @@ spec: selector: io.kompose.service: mongo - --- apiVersion: v1 kind: Service metadata: - annotations: - kompose.service.group: my-group - kompose.service.healthcheck.liveness.tcp_port: "8081" - kompose.service.healthcheck.readiness.interval: 11s - kompose.service.healthcheck.readiness.retries: "6" - kompose.service.healthcheck.readiness.tcp_port: "9091" - kompose.service.healthcheck.readiness.timeout: 2s creationTimestamp: null labels: io.kompose.service: mysql @@ -45,19 +30,10 @@ spec: selector: io.kompose.service: mysql - --- apiVersion: v1 kind: Service metadata: - annotations: - kompose.service.healthcheck.liveness.http_get_path: /health - kompose.service.healthcheck.liveness.http_get_port: "8080" - kompose.service.healthcheck.readiness.http_get_path: /ready - kompose.service.healthcheck.readiness.http_get_port: "8080" - kompose.service.healthcheck.readiness.interval: 10s - kompose.service.healthcheck.readiness.retries: "5" - kompose.service.healthcheck.readiness.timeout: 1s creationTimestamp: null labels: io.kompose.service: postgresql @@ -70,16 +46,10 @@ spec: selector: io.kompose.service: postgresql - --- apiVersion: v1 kind: Service metadata: - annotations: - kompose.service.healthcheck.readiness.interval: 10s - kompose.service.healthcheck.readiness.retries: "5" - kompose.service.healthcheck.readiness.test: echo "liveness" - kompose.service.healthcheck.readiness.timeout: 1s creationTimestamp: null labels: io.kompose.service: redis @@ -92,18 +62,10 @@ spec: selector: io.kompose.service: redis - --- apiVersion: apps.openshift.io/v1 kind: DeploymentConfig metadata: - annotations: - kompose.service.group: my-group - kompose.service.healthcheck.liveness.tcp_port: "8080" - kompose.service.healthcheck.readiness.interval: 10s - kompose.service.healthcheck.readiness.retries: "5" - kompose.service.healthcheck.readiness.tcp_port: "9090" - kompose.service.healthcheck.readiness.timeout: 1s creationTimestamp: null labels: io.kompose.service: mongo @@ -153,7 +115,6 @@ spec: name: mongo:latest type: ImageChange - --- apiVersion: image.openshift.io/v1 kind: ImageStream @@ -176,18 +137,10 @@ spec: referencePolicy: type: "" - --- apiVersion: apps.openshift.io/v1 kind: DeploymentConfig metadata: - annotations: - kompose.service.group: my-group - kompose.service.healthcheck.liveness.tcp_port: "8081" - kompose.service.healthcheck.readiness.interval: 11s - kompose.service.healthcheck.readiness.retries: "6" - kompose.service.healthcheck.readiness.tcp_port: "9091" - kompose.service.healthcheck.readiness.timeout: 2s creationTimestamp: null labels: io.kompose.service: mysql @@ -237,7 +190,6 @@ spec: name: mysql:latest type: ImageChange - --- apiVersion: image.openshift.io/v1 kind: ImageStream @@ -260,19 +212,10 @@ spec: referencePolicy: type: "" - --- apiVersion: apps.openshift.io/v1 kind: DeploymentConfig metadata: - annotations: - kompose.service.healthcheck.liveness.http_get_path: /health - kompose.service.healthcheck.liveness.http_get_port: "8080" - kompose.service.healthcheck.readiness.http_get_path: /ready - kompose.service.healthcheck.readiness.http_get_port: "8080" - kompose.service.healthcheck.readiness.interval: 10s - kompose.service.healthcheck.readiness.retries: "5" - kompose.service.healthcheck.readiness.timeout: 1s creationTimestamp: null labels: io.kompose.service: postgresql @@ -324,7 +267,6 @@ spec: name: postgresql:latest type: ImageChange - --- apiVersion: image.openshift.io/v1 kind: ImageStream @@ -347,16 +289,10 @@ spec: referencePolicy: type: "" - --- apiVersion: apps.openshift.io/v1 kind: DeploymentConfig metadata: - annotations: - kompose.service.healthcheck.readiness.interval: 10s - kompose.service.healthcheck.readiness.retries: "5" - kompose.service.healthcheck.readiness.test: echo "liveness" - kompose.service.healthcheck.readiness.timeout: 1s creationTimestamp: null labels: io.kompose.service: redis @@ -409,7 +345,6 @@ spec: name: redis:latest type: ImageChange - --- apiVersion: image.openshift.io/v1 kind: ImageStream @@ -432,4 +367,3 @@ spec: referencePolicy: type: "" - diff --git a/script/test/fixtures/multiple-type-volumes/output-k8s.yaml b/script/test/fixtures/multiple-type-volumes/output-k8s.yaml index 1e928200f..58ad99478 100644 --- a/script/test/fixtures/multiple-type-volumes/output-k8s.yaml +++ b/script/test/fixtures/multiple-type-volumes/output-k8s.yaml @@ -2,8 +2,6 @@ apiVersion: apps/v1 kind: Deployment metadata: - annotations: - kompose.volume.type: persistentVolumeClaim creationTimestamp: null labels: io.kompose.service: db @@ -17,8 +15,6 @@ spec: type: Recreate template: metadata: - annotations: - kompose.volume.type: persistentVolumeClaim creationTimestamp: null labels: io.kompose.network/multiple-type-volumes-default: "true" @@ -37,7 +33,6 @@ spec: persistentVolumeClaim: claimName: db-data - --- apiVersion: v1 kind: PersistentVolumeClaim @@ -53,13 +48,10 @@ spec: requests: storage: 100Mi - --- apiVersion: apps/v1 kind: Deployment metadata: - annotations: - kompose.volume.type: configMap creationTimestamp: null labels: io.kompose.service: web @@ -73,8 +65,6 @@ spec: type: Recreate template: metadata: - annotations: - kompose.volume.type: configMap creationTimestamp: null labels: io.kompose.network/multiple-type-volumes-default: "true" @@ -102,7 +92,6 @@ spec: name: web-cm1 name: web-cm1 - --- apiVersion: v1 data: diff --git a/script/test/fixtures/multiple-type-volumes/output-os.yaml b/script/test/fixtures/multiple-type-volumes/output-os.yaml index 0b076b184..0ee4879fa 100644 --- a/script/test/fixtures/multiple-type-volumes/output-os.yaml +++ b/script/test/fixtures/multiple-type-volumes/output-os.yaml @@ -2,8 +2,6 @@ apiVersion: apps.openshift.io/v1 kind: DeploymentConfig metadata: - annotations: - kompose.volume.type: persistentVolumeClaim creationTimestamp: null labels: io.kompose.service: db @@ -46,7 +44,6 @@ spec: name: db:latest type: ImageChange - --- apiVersion: image.openshift.io/v1 kind: ImageStream @@ -69,7 +66,6 @@ spec: referencePolicy: type: "" - --- apiVersion: v1 kind: PersistentVolumeClaim @@ -85,13 +81,10 @@ spec: requests: storage: 100Mi - --- apiVersion: apps.openshift.io/v1 kind: DeploymentConfig metadata: - annotations: - kompose.volume.type: configMap creationTimestamp: null labels: io.kompose.service: web @@ -143,7 +136,6 @@ spec: name: web:latest type: ImageChange - --- apiVersion: image.openshift.io/v1 kind: ImageStream @@ -166,7 +158,6 @@ spec: referencePolicy: type: "" - --- apiVersion: v1 data: diff --git a/script/test/fixtures/single-file-output/output-k8s.yaml b/script/test/fixtures/single-file-output/output-k8s.yaml index f38286339..6aa2b405c 100644 --- a/script/test/fixtures/single-file-output/output-k8s.yaml +++ b/script/test/fixtures/single-file-output/output-k8s.yaml @@ -2,9 +2,6 @@ apiVersion: v1 kind: Service metadata: - annotations: - kompose.service.expose: lb - kompose.service.expose.ingress-class-name: nginx creationTimestamp: null labels: io.kompose.service: front-end @@ -17,14 +14,10 @@ spec: selector: io.kompose.service: front-end - --- apiVersion: apps/v1 kind: Deployment metadata: - annotations: - kompose.service.expose: lb - kompose.service.expose.ingress-class-name: nginx creationTimestamp: null labels: io.kompose.service: front-end @@ -37,9 +30,6 @@ spec: strategy: {} template: metadata: - annotations: - kompose.service.expose: lb - kompose.service.expose.ingress-class-name: nginx creationTimestamp: null labels: io.kompose.network/single-file-output-default: "true" @@ -58,14 +48,10 @@ spec: resources: {} restartPolicy: Always - --- apiVersion: networking.k8s.io/v1 kind: Ingress metadata: - annotations: - kompose.service.expose: lb - kompose.service.expose.ingress-class-name: nginx creationTimestamp: null labels: io.kompose.service: front-end @@ -84,4 +70,3 @@ spec: path: / pathType: Prefix - diff --git a/script/test/fixtures/vols-subpath/output-k8s.yaml b/script/test/fixtures/vols-subpath/output-k8s.yaml index d090bd801..cbd95e66a 100644 --- a/script/test/fixtures/vols-subpath/output-k8s.yaml +++ b/script/test/fixtures/vols-subpath/output-k8s.yaml @@ -2,8 +2,6 @@ apiVersion: apps/v1 kind: Deployment metadata: - annotations: - kompose.volume.subpath: test creationTimestamp: null labels: io.kompose.service: postgres @@ -17,8 +15,6 @@ spec: type: Recreate template: metadata: - annotations: - kompose.volume.subpath: test creationTimestamp: null labels: io.kompose.network/vols-subpath-default: "true" @@ -45,7 +41,6 @@ spec: persistentVolumeClaim: claimName: postgres-data - --- apiVersion: v1 kind: PersistentVolumeClaim diff --git a/script/test/fixtures/vols-subpath/output-os.yaml b/script/test/fixtures/vols-subpath/output-os.yaml index e49432139..ddb9c007c 100644 --- a/script/test/fixtures/vols-subpath/output-os.yaml +++ b/script/test/fixtures/vols-subpath/output-os.yaml @@ -2,8 +2,6 @@ apiVersion: apps.openshift.io/v1 kind: DeploymentConfig metadata: - annotations: - kompose.volume.subpath: test creationTimestamp: null labels: io.kompose.service: postgres @@ -54,7 +52,6 @@ spec: name: postgres:latest type: ImageChange - --- apiVersion: image.openshift.io/v1 kind: ImageStream @@ -77,7 +74,6 @@ spec: referencePolicy: type: "" - --- apiVersion: v1 kind: PersistentVolumeClaim @@ -93,4 +89,3 @@ spec: requests: storage: 100Mi -