From 792976da1f61db3972d6b701e80da7368aa3c4a0 Mon Sep 17 00:00:00 2001 From: Tomas Kral Date: Thu, 27 Apr 2017 13:27:49 +0200 Subject: [PATCH] some of created objects were missing io.kompose.service label label added to BuildConfig, DaemonSet, ReplicationController, Deployment and Pod --- pkg/transformer/kubernetes/kubernetes.go | 12 ++-- pkg/transformer/kubernetes/kubernetes_test.go | 8 +-- pkg/transformer/openshift/openshift.go | 4 +- .../buildargs/output-os-template.json | 10 ++- .../test/fixtures/bundles/dab/output-k8s.json | 10 ++- .../test/fixtures/bundles/dsb/output-k8s.json | 21 +++++- .../entrypoint-command/output-k8s.json | 5 +- .../envvars-separators/output-k8s.json | 65 +++++++++++++++---- script/test/fixtures/etherpad/output-k8s.json | 10 ++- ...rnetes-expose-hostname-multiple-ports.json | 8 ++- .../kubernetes-expose-hostname.json | 8 ++- ...kubernetes-expose-true-multiple-ports.json | 8 ++- .../kubernetes-expose-true.json | 8 ++- script/test/fixtures/gitlab/output-k8s.json | 15 ++++- .../fixtures/keyonly-envs/output-k8s.json | 15 ++++- .../test/fixtures/mem-limit/output-k8s.json | 5 +- .../fixtures/mem-limit/output-mb-k8s.json | 5 +- .../multiple-compose-files/output-k8s.json | 10 ++- .../fixtures/nginx-node-redis/output-k8s.json | 25 +++++-- .../nginx-node-redis/output-os-template.json | 22 +++++-- .../fixtures/ports-with-ip/output-k8s.json | 10 ++- .../fixtures/ports-with-proto/output-k8s.json | 10 ++- .../service-name-change/output-k8s.json | 10 ++- .../test/fixtures/stdin-true/output-k8s.json | 5 +- script/test/fixtures/tty-true/output-k8s.json | 5 +- .../simple-vol-mounts/output-k8s.json | 5 +- .../volumes-from/output-k8s.json | 10 ++- .../fixtures/yaml-and-yml/output-k8s.json | 10 ++- .../fixtures/yaml-and-yml/yml/output-k8s.json | 10 ++- 29 files changed, 278 insertions(+), 71 deletions(-) diff --git a/pkg/transformer/kubernetes/kubernetes.go b/pkg/transformer/kubernetes/kubernetes.go index e1b55ae6..15c6a9cc 100644 --- a/pkg/transformer/kubernetes/kubernetes.go +++ b/pkg/transformer/kubernetes/kubernetes.go @@ -130,7 +130,8 @@ func (k *Kubernetes) InitRC(name string, service kobject.ServiceConfig, replicas APIVersion: "v1", }, ObjectMeta: api.ObjectMeta{ - Name: name, + Name: name, + Labels: transformer.ConfigLabels(name), }, Spec: api.ReplicationControllerSpec{ Replicas: int32(replicas), @@ -171,7 +172,8 @@ func (k *Kubernetes) InitD(name string, service kobject.ServiceConfig, replicas APIVersion: "extensions/v1beta1", }, ObjectMeta: api.ObjectMeta{ - Name: name, + Name: name, + Labels: transformer.ConfigLabels(name), }, Spec: extensions.DeploymentSpec{ Replicas: int32(replicas), @@ -191,7 +193,8 @@ func (k *Kubernetes) InitDS(name string, service kobject.ServiceConfig) *extensi APIVersion: "extensions/v1beta1", }, ObjectMeta: api.ObjectMeta{ - Name: name, + Name: name, + Labels: transformer.ConfigLabels(name), }, Spec: extensions.DaemonSetSpec{ Template: api.PodTemplateSpec{ @@ -513,7 +516,8 @@ func (k *Kubernetes) InitPod(name string, service kobject.ServiceConfig) *api.Po APIVersion: "v1", }, ObjectMeta: api.ObjectMeta{ - Name: name, + Name: name, + Labels: transformer.ConfigLabels(name), }, Spec: k.InitPodSpec(name, service.Image), } diff --git a/pkg/transformer/kubernetes/kubernetes_test.go b/pkg/transformer/kubernetes/kubernetes_test.go index 19e8fc77..9489c033 100644 --- a/pkg/transformer/kubernetes/kubernetes_test.go +++ b/pkg/transformer/kubernetes/kubernetes_test.go @@ -311,7 +311,7 @@ func TestKomposeConvert(t *testing.T) { if err := checkPodTemplate(config, d.Spec.Template, labels); err != nil { t.Errorf("%v", err) } - if err := checkMeta(config, d.ObjectMeta, name, false); err != nil { + if err := checkMeta(config, d.ObjectMeta, name, true); err != nil { t.Errorf("%v", err) } if (int)(d.Spec.Replicas) != replicas { @@ -328,7 +328,7 @@ func TestKomposeConvert(t *testing.T) { if err := checkPodTemplate(config, ds.Spec.Template, labels); err != nil { t.Errorf("%v", err) } - if err := checkMeta(config, ds.ObjectMeta, name, false); err != nil { + if err := checkMeta(config, ds.ObjectMeta, name, true); err != nil { t.Errorf("%v", err) } if ds.Spec.Selector != nil && len(ds.Spec.Selector.MatchLabels) > 0 { @@ -342,7 +342,7 @@ func TestKomposeConvert(t *testing.T) { if err := checkPodTemplate(config, *rc.Spec.Template, labels); err != nil { t.Errorf("%v", err) } - if err := checkMeta(config, rc.ObjectMeta, name, false); err != nil { + if err := checkMeta(config, rc.ObjectMeta, name, true); err != nil { t.Errorf("%v", err) } if (int)(rc.Spec.Replicas) != replicas { @@ -360,7 +360,7 @@ func TestKomposeConvert(t *testing.T) { if err := checkPodTemplate(config, *dc.Spec.Template, labels); err != nil { t.Errorf("%v", err) } - if err := checkMeta(config, dc.ObjectMeta, name, false); err != nil { + if err := checkMeta(config, dc.ObjectMeta, name, true); err != nil { t.Errorf("%v", err) } if (int)(dc.Spec.Replicas) != replicas { diff --git a/pkg/transformer/openshift/openshift.go b/pkg/transformer/openshift/openshift.go index 975fe8c4..93709bc7 100644 --- a/pkg/transformer/openshift/openshift.go +++ b/pkg/transformer/openshift/openshift.go @@ -216,8 +216,10 @@ func initBuildConfig(name string, service kobject.ServiceConfig, repo string, br Kind: "BuildConfig", APIVersion: "v1", }, + ObjectMeta: kapi.ObjectMeta{ - Name: name, + Name: name, + Labels: transformer.ConfigLabels(name), }, Spec: buildapi.BuildConfigSpec{ Triggers: []buildapi.BuildTriggerPolicy{ diff --git a/script/test/fixtures/buildargs/output-os-template.json b/script/test/fixtures/buildargs/output-os-template.json index 04ce1e9c..4150b830 100644 --- a/script/test/fixtures/buildargs/output-os-template.json +++ b/script/test/fixtures/buildargs/output-os-template.json @@ -139,7 +139,10 @@ "apiVersion": "v1", "metadata": { "name": "foo1", - "creationTimestamp": null + "creationTimestamp": null, + "labels": { + "io.kompose.service": "foo1" + } }, "spec": { "triggers": [ @@ -270,7 +273,10 @@ "apiVersion": "v1", "metadata": { "name": "foo", - "creationTimestamp": null + "creationTimestamp": null, + "labels": { + "io.kompose.service": "foo" + } }, "spec": { "triggers": [ diff --git a/script/test/fixtures/bundles/dab/output-k8s.json b/script/test/fixtures/bundles/dab/output-k8s.json index bccaf809..f0a75e36 100644 --- a/script/test/fixtures/bundles/dab/output-k8s.json +++ b/script/test/fixtures/bundles/dab/output-k8s.json @@ -60,7 +60,10 @@ "apiVersion": "extensions/v1beta1", "metadata": { "name": "redis", - "creationTimestamp": null + "creationTimestamp": null, + "labels": { + "io.kompose.service": "redis" + } }, "spec": { "replicas": 1, @@ -96,7 +99,10 @@ "apiVersion": "extensions/v1beta1", "metadata": { "name": "web", - "creationTimestamp": null + "creationTimestamp": null, + "labels": { + "io.kompose.service": "web" + } }, "spec": { "replicas": 1, diff --git a/script/test/fixtures/bundles/dsb/output-k8s.json b/script/test/fixtures/bundles/dsb/output-k8s.json index 32a20ce8..499b1659 100644 --- a/script/test/fixtures/bundles/dsb/output-k8s.json +++ b/script/test/fixtures/bundles/dsb/output-k8s.json @@ -146,6 +146,9 @@ "metadata": { "name": "db", "creationTimestamp": null, + "labels": { + "io.kompose.service": "db" + }, "annotations": { "com.example.description": "Postgres Database" } @@ -184,7 +187,10 @@ "apiVersion": "extensions/v1beta1", "metadata": { "name": "redis", - "creationTimestamp": null + "creationTimestamp": null, + "labels": { + "io.kompose.service": "redis" + } }, "spec": { "replicas": 1, @@ -220,7 +226,10 @@ "apiVersion": "extensions/v1beta1", "metadata": { "name": "result", - "creationTimestamp": null + "creationTimestamp": null, + "labels": { + "io.kompose.service": "result" + } }, "spec": { "replicas": 1, @@ -257,6 +266,9 @@ "metadata": { "name": "vote", "creationTimestamp": null, + "labels": { + "io.kompose.service": "vote" + }, "annotations": { "com.example.description": "Vote" } @@ -295,7 +307,10 @@ "apiVersion": "extensions/v1beta1", "metadata": { "name": "worker", - "creationTimestamp": null + "creationTimestamp": null, + "labels": { + "io.kompose.service": "worker" + } }, "spec": { "replicas": 1, diff --git a/script/test/fixtures/entrypoint-command/output-k8s.json b/script/test/fixtures/entrypoint-command/output-k8s.json index 0faa005d..d26d5707 100644 --- a/script/test/fixtures/entrypoint-command/output-k8s.json +++ b/script/test/fixtures/entrypoint-command/output-k8s.json @@ -35,7 +35,10 @@ "apiVersion": "extensions/v1beta1", "metadata": { "name": "base", - "creationTimestamp": null + "creationTimestamp": null, + "labels": { + "io.kompose.service": "base" + } }, "spec": { "replicas": 1, diff --git a/script/test/fixtures/envvars-separators/output-k8s.json b/script/test/fixtures/envvars-separators/output-k8s.json index 1b02cbaa..727b6dd8 100644 --- a/script/test/fixtures/envvars-separators/output-k8s.json +++ b/script/test/fixtures/envvars-separators/output-k8s.json @@ -356,7 +356,10 @@ "apiVersion": "extensions/v1beta1", "metadata": { "name": "hygieia-api", - "creationTimestamp": null + "creationTimestamp": null, + "labels": { + "io.kompose.service": "hygieia-api" + } }, "spec": { "replicas": 1, @@ -430,7 +433,10 @@ "apiVersion": "extensions/v1beta1", "metadata": { "name": "hygieia-bitbucket-scm-collector", - "creationTimestamp": null + "creationTimestamp": null, + "labels": { + "io.kompose.service": "hygieia-bitbucket-scm-collector" + } }, "spec": { "replicas": 1, @@ -499,7 +505,10 @@ "apiVersion": "extensions/v1beta1", "metadata": { "name": "hygieia-chat-ops-collector", - "creationTimestamp": null + "creationTimestamp": null, + "labels": { + "io.kompose.service": "hygieia-chat-ops-collector" + } }, "spec": { "replicas": 1, @@ -568,7 +577,10 @@ "apiVersion": "extensions/v1beta1", "metadata": { "name": "hygieia-github-scm-collector", - "creationTimestamp": null + "creationTimestamp": null, + "labels": { + "io.kompose.service": "hygieia-github-scm-collector" + } }, "spec": { "replicas": 1, @@ -637,7 +649,10 @@ "apiVersion": "extensions/v1beta1", "metadata": { "name": "hygieia-jenkins-build-collector", - "creationTimestamp": null + "creationTimestamp": null, + "labels": { + "io.kompose.service": "hygieia-jenkins-build-collector" + } }, "spec": { "replicas": 1, @@ -706,7 +721,10 @@ "apiVersion": "extensions/v1beta1", "metadata": { "name": "hygieia-jenkins-cucumber-test-collector", - "creationTimestamp": null + "creationTimestamp": null, + "labels": { + "io.kompose.service": "hygieia-jenkins-cucumber-test-collector" + } }, "spec": { "replicas": 1, @@ -775,7 +793,10 @@ "apiVersion": "extensions/v1beta1", "metadata": { "name": "hygieia-jira-feature-collector", - "creationTimestamp": null + "creationTimestamp": null, + "labels": { + "io.kompose.service": "hygieia-jira-feature-collector" + } }, "spec": { "replicas": 1, @@ -854,7 +875,10 @@ "apiVersion": "extensions/v1beta1", "metadata": { "name": "hygieia-sonar-codequality-collector", - "creationTimestamp": null + "creationTimestamp": null, + "labels": { + "io.kompose.service": "hygieia-sonar-codequality-collector" + } }, "spec": { "replicas": 1, @@ -923,7 +947,10 @@ "apiVersion": "extensions/v1beta1", "metadata": { "name": "hygieia-subversion-scm-collector", - "creationTimestamp": null + "creationTimestamp": null, + "labels": { + "io.kompose.service": "hygieia-subversion-scm-collector" + } }, "spec": { "replicas": 1, @@ -992,7 +1019,10 @@ "apiVersion": "extensions/v1beta1", "metadata": { "name": "hygieia-udeploy-collector", - "creationTimestamp": null + "creationTimestamp": null, + "labels": { + "io.kompose.service": "hygieia-udeploy-collector" + } }, "spec": { "replicas": 1, @@ -1075,7 +1105,10 @@ "apiVersion": "extensions/v1beta1", "metadata": { "name": "hygieia-ui", - "creationTimestamp": null + "creationTimestamp": null, + "labels": { + "io.kompose.service": "hygieia-ui" + } }, "spec": { "replicas": 1, @@ -1111,7 +1144,10 @@ "apiVersion": "extensions/v1beta1", "metadata": { "name": "hygieia-versionone-collector", - "creationTimestamp": null + "creationTimestamp": null, + "labels": { + "io.kompose.service": "hygieia-versionone-collector" + } }, "spec": { "replicas": 1, @@ -1180,7 +1216,10 @@ "apiVersion": "extensions/v1beta1", "metadata": { "name": "mongodb", - "creationTimestamp": null + "creationTimestamp": null, + "labels": { + "io.kompose.service": "mongodb" + } }, "spec": { "replicas": 1, diff --git a/script/test/fixtures/etherpad/output-k8s.json b/script/test/fixtures/etherpad/output-k8s.json index 20fdd6e7..8af68c9a 100644 --- a/script/test/fixtures/etherpad/output-k8s.json +++ b/script/test/fixtures/etherpad/output-k8s.json @@ -60,7 +60,10 @@ "apiVersion": "extensions/v1beta1", "metadata": { "name": "etherpad", - "creationTimestamp": null + "creationTimestamp": null, + "labels": { + "io.kompose.service": "etherpad" + } }, "spec": { "replicas": 1, @@ -118,7 +121,10 @@ "apiVersion": "extensions/v1beta1", "metadata": { "name": "mariadb", - "creationTimestamp": null + "creationTimestamp": null, + "labels": { + "io.kompose.service": "mariadb" + } }, "spec": { "replicas": 1, diff --git a/script/test/fixtures/expose-service/provider-files/kubernetes-expose-hostname-multiple-ports.json b/script/test/fixtures/expose-service/provider-files/kubernetes-expose-hostname-multiple-ports.json index d2dc9ce4..9e0bbc0e 100644 --- a/script/test/fixtures/expose-service/provider-files/kubernetes-expose-hostname-multiple-ports.json +++ b/script/test/fixtures/expose-service/provider-files/kubernetes-expose-hostname-multiple-ports.json @@ -68,7 +68,10 @@ "apiVersion": "extensions/v1beta1", "metadata": { "name": "redis", - "creationTimestamp": null + "creationTimestamp": null, + "labels": { + "io.kompose.service": "redis" + } }, "spec": { "replicas": 1, @@ -105,6 +108,9 @@ "metadata": { "name": "web", "creationTimestamp": null, + "labels": { + "io.kompose.service": "web" + }, "annotations": { "kompose.service.expose": "batman.example.com" } diff --git a/script/test/fixtures/expose-service/provider-files/kubernetes-expose-hostname.json b/script/test/fixtures/expose-service/provider-files/kubernetes-expose-hostname.json index 902be11a..98d604e3 100644 --- a/script/test/fixtures/expose-service/provider-files/kubernetes-expose-hostname.json +++ b/script/test/fixtures/expose-service/provider-files/kubernetes-expose-hostname.json @@ -63,7 +63,10 @@ "apiVersion": "extensions/v1beta1", "metadata": { "name": "redis", - "creationTimestamp": null + "creationTimestamp": null, + "labels": { + "io.kompose.service": "redis" + } }, "spec": { "replicas": 1, @@ -100,6 +103,9 @@ "metadata": { "name": "web", "creationTimestamp": null, + "labels": { + "io.kompose.service": "web" + }, "annotations": { "kompose.service.expose": "batman.example.com" } diff --git a/script/test/fixtures/expose-service/provider-files/kubernetes-expose-true-multiple-ports.json b/script/test/fixtures/expose-service/provider-files/kubernetes-expose-true-multiple-ports.json index b6842d7b..e378ef9c 100644 --- a/script/test/fixtures/expose-service/provider-files/kubernetes-expose-true-multiple-ports.json +++ b/script/test/fixtures/expose-service/provider-files/kubernetes-expose-true-multiple-ports.json @@ -68,7 +68,10 @@ "apiVersion": "extensions/v1beta1", "metadata": { "name": "redis", - "creationTimestamp": null + "creationTimestamp": null, + "labels": { + "io.kompose.service": "redis" + } }, "spec": { "replicas": 1, @@ -105,6 +108,9 @@ "metadata": { "name": "web", "creationTimestamp": null, + "labels": { + "io.kompose.service": "web" + }, "annotations": { "kompose.service.expose": "True" } diff --git a/script/test/fixtures/expose-service/provider-files/kubernetes-expose-true.json b/script/test/fixtures/expose-service/provider-files/kubernetes-expose-true.json index ab77b2a4..4a96c0bd 100644 --- a/script/test/fixtures/expose-service/provider-files/kubernetes-expose-true.json +++ b/script/test/fixtures/expose-service/provider-files/kubernetes-expose-true.json @@ -63,7 +63,10 @@ "apiVersion": "extensions/v1beta1", "metadata": { "name": "redis", - "creationTimestamp": null + "creationTimestamp": null, + "labels": { + "io.kompose.service": "redis" + } }, "spec": { "replicas": 1, @@ -100,6 +103,9 @@ "metadata": { "name": "web", "creationTimestamp": null, + "labels": { + "io.kompose.service": "web" + }, "annotations": { "kompose.service.expose": "True" } diff --git a/script/test/fixtures/gitlab/output-k8s.json b/script/test/fixtures/gitlab/output-k8s.json index d09e8015..386875c0 100644 --- a/script/test/fixtures/gitlab/output-k8s.json +++ b/script/test/fixtures/gitlab/output-k8s.json @@ -96,7 +96,10 @@ "apiVersion": "extensions/v1beta1", "metadata": { "name": "gitlab", - "creationTimestamp": null + "creationTimestamp": null, + "labels": { + "io.kompose.service": "gitlab" + } }, "spec": { "replicas": 1, @@ -172,7 +175,10 @@ "apiVersion": "extensions/v1beta1", "metadata": { "name": "postgresql", - "creationTimestamp": null + "creationTimestamp": null, + "labels": { + "io.kompose.service": "postgresql" + } }, "spec": { "replicas": 1, @@ -222,7 +228,10 @@ "apiVersion": "extensions/v1beta1", "metadata": { "name": "redis", - "creationTimestamp": null + "creationTimestamp": null, + "labels": { + "io.kompose.service": "redis" + } }, "spec": { "replicas": 1, diff --git a/script/test/fixtures/keyonly-envs/output-k8s.json b/script/test/fixtures/keyonly-envs/output-k8s.json index 5605984a..9b60c84e 100644 --- a/script/test/fixtures/keyonly-envs/output-k8s.json +++ b/script/test/fixtures/keyonly-envs/output-k8s.json @@ -86,7 +86,10 @@ "apiVersion": "extensions/v1beta1", "metadata": { "name": "frontend", - "creationTimestamp": null + "creationTimestamp": null, + "labels": { + "io.kompose.service": "frontend" + } }, "spec": { "replicas": 1, @@ -140,7 +143,10 @@ "apiVersion": "extensions/v1beta1", "metadata": { "name": "redis-master", - "creationTimestamp": null + "creationTimestamp": null, + "labels": { + "io.kompose.service": "redis-master" + } }, "spec": { "replicas": 1, @@ -176,7 +182,10 @@ "apiVersion": "extensions/v1beta1", "metadata": { "name": "redis-slave", - "creationTimestamp": null + "creationTimestamp": null, + "labels": { + "io.kompose.service": "redis-slave" + } }, "spec": { "replicas": 1, diff --git a/script/test/fixtures/mem-limit/output-k8s.json b/script/test/fixtures/mem-limit/output-k8s.json index dd7828d3..02ba1b5b 100644 --- a/script/test/fixtures/mem-limit/output-k8s.json +++ b/script/test/fixtures/mem-limit/output-k8s.json @@ -40,7 +40,10 @@ "apiVersion": "extensions/v1beta1", "metadata": { "name": "redis", - "creationTimestamp": null + "creationTimestamp": null, + "labels": { + "io.kompose.service": "redis" + } }, "spec": { "replicas": 1, diff --git a/script/test/fixtures/mem-limit/output-mb-k8s.json b/script/test/fixtures/mem-limit/output-mb-k8s.json index 868a3681..466de9c5 100644 --- a/script/test/fixtures/mem-limit/output-mb-k8s.json +++ b/script/test/fixtures/mem-limit/output-mb-k8s.json @@ -40,7 +40,10 @@ "apiVersion": "extensions/v1beta1", "metadata": { "name": "redis", - "creationTimestamp": null + "creationTimestamp": null, + "labels": { + "io.kompose.service": "redis" + } }, "spec": { "replicas": 1, diff --git a/script/test/fixtures/multiple-compose-files/output-k8s.json b/script/test/fixtures/multiple-compose-files/output-k8s.json index 18c834d3..af03e694 100644 --- a/script/test/fixtures/multiple-compose-files/output-k8s.json +++ b/script/test/fixtures/multiple-compose-files/output-k8s.json @@ -70,7 +70,10 @@ "apiVersion": "extensions/v1beta1", "metadata": { "name": "etherpad", - "creationTimestamp": null + "creationTimestamp": null, + "labels": { + "io.kompose.service": "etherpad" + } }, "spec": { "replicas": 1, @@ -131,7 +134,10 @@ "apiVersion": "extensions/v1beta1", "metadata": { "name": "mariadb", - "creationTimestamp": null + "creationTimestamp": null, + "labels": { + "io.kompose.service": "mariadb" + } }, "spec": { "replicas": 1, diff --git a/script/test/fixtures/nginx-node-redis/output-k8s.json b/script/test/fixtures/nginx-node-redis/output-k8s.json index 707ab180..2e7fb750 100644 --- a/script/test/fixtures/nginx-node-redis/output-k8s.json +++ b/script/test/fixtures/nginx-node-redis/output-k8s.json @@ -138,7 +138,10 @@ "apiVersion": "extensions/v1beta1", "metadata": { "name": "nginx", - "creationTimestamp": null + "creationTimestamp": null, + "labels": { + "io.kompose.service": "nginx" + } }, "spec": { "replicas": 1, @@ -173,7 +176,10 @@ "apiVersion": "extensions/v1beta1", "metadata": { "name": "node1", - "creationTimestamp": null + "creationTimestamp": null, + "labels": { + "io.kompose.service": "node1" + } }, "spec": { "replicas": 1, @@ -208,7 +214,10 @@ "apiVersion": "extensions/v1beta1", "metadata": { "name": "node2", - "creationTimestamp": null + "creationTimestamp": null, + "labels": { + "io.kompose.service": "node2" + } }, "spec": { "replicas": 1, @@ -243,7 +252,10 @@ "apiVersion": "extensions/v1beta1", "metadata": { "name": "node3", - "creationTimestamp": null + "creationTimestamp": null, + "labels": { + "io.kompose.service": "node3" + } }, "spec": { "replicas": 1, @@ -278,7 +290,10 @@ "apiVersion": "extensions/v1beta1", "metadata": { "name": "redis", - "creationTimestamp": null + "creationTimestamp": null, + "labels": { + "io.kompose.service": "redis" + } }, "spec": { "replicas": 1, diff --git a/script/test/fixtures/nginx-node-redis/output-os-template.json b/script/test/fixtures/nginx-node-redis/output-os-template.json index 202cbb81..384e0a0a 100644 --- a/script/test/fixtures/nginx-node-redis/output-os-template.json +++ b/script/test/fixtures/nginx-node-redis/output-os-template.json @@ -216,7 +216,10 @@ "apiVersion": "v1", "metadata": { "name": "nginx", - "creationTimestamp": null + "creationTimestamp": null, + "labels": { + "io.kompose.service": "nginx" + } }, "spec": { "triggers": [ @@ -337,7 +340,10 @@ "apiVersion": "v1", "metadata": { "name": "node1", - "creationTimestamp": null + "creationTimestamp": null, + "labels": { + "io.kompose.service": "node1" + } }, "spec": { "triggers": [ @@ -458,7 +464,10 @@ "apiVersion": "v1", "metadata": { "name": "node2", - "creationTimestamp": null + "creationTimestamp": null, + "labels": { + "io.kompose.service": "node2" + } }, "spec": { "triggers": [ @@ -579,7 +588,10 @@ "apiVersion": "v1", "metadata": { "name": "node3", - "creationTimestamp": null + "creationTimestamp": null, + "labels": { + "io.kompose.service": "node3" + } }, "spec": { "triggers": [ @@ -709,4 +721,4 @@ } } ] -} +} \ No newline at end of file diff --git a/script/test/fixtures/ports-with-ip/output-k8s.json b/script/test/fixtures/ports-with-ip/output-k8s.json index 07de3f8b..0a24eef9 100644 --- a/script/test/fixtures/ports-with-ip/output-k8s.json +++ b/script/test/fixtures/ports-with-ip/output-k8s.json @@ -66,7 +66,10 @@ "apiVersion": "extensions/v1beta1", "metadata": { "name": "redis", - "creationTimestamp": null + "creationTimestamp": null, + "labels": { + "io.kompose.service": "redis" + } }, "spec": { "replicas": 1, @@ -106,7 +109,10 @@ "apiVersion": "extensions/v1beta1", "metadata": { "name": "web", - "creationTimestamp": null + "creationTimestamp": null, + "labels": { + "io.kompose.service": "web" + } }, "spec": { "replicas": 1, diff --git a/script/test/fixtures/ports-with-proto/output-k8s.json b/script/test/fixtures/ports-with-proto/output-k8s.json index c62891b8..41aeb491 100644 --- a/script/test/fixtures/ports-with-proto/output-k8s.json +++ b/script/test/fixtures/ports-with-proto/output-k8s.json @@ -66,7 +66,10 @@ "apiVersion": "extensions/v1beta1", "metadata": { "name": "redis", - "creationTimestamp": null + "creationTimestamp": null, + "labels": { + "io.kompose.service": "redis" + } }, "spec": { "replicas": 1, @@ -106,7 +109,10 @@ "apiVersion": "extensions/v1beta1", "metadata": { "name": "web", - "creationTimestamp": null + "creationTimestamp": null, + "labels": { + "io.kompose.service": "web" + } }, "spec": { "replicas": 1, diff --git a/script/test/fixtures/service-name-change/output-k8s.json b/script/test/fixtures/service-name-change/output-k8s.json index 04443310..bd4699b1 100644 --- a/script/test/fixtures/service-name-change/output-k8s.json +++ b/script/test/fixtures/service-name-change/output-k8s.json @@ -66,7 +66,10 @@ "apiVersion": "extensions/v1beta1", "metadata": { "name": "mariadb", - "creationTimestamp": null + "creationTimestamp": null, + "labels": { + "io.kompose.service": "mariadb" + } }, "spec": { "replicas": 1, @@ -149,7 +152,10 @@ "apiVersion": "extensions/v1beta1", "metadata": { "name": "wordpress", - "creationTimestamp": null + "creationTimestamp": null, + "labels": { + "io.kompose.service": "wordpress" + } }, "spec": { "replicas": 1, diff --git a/script/test/fixtures/stdin-true/output-k8s.json b/script/test/fixtures/stdin-true/output-k8s.json index d200cdcf..9173c74b 100644 --- a/script/test/fixtures/stdin-true/output-k8s.json +++ b/script/test/fixtures/stdin-true/output-k8s.json @@ -34,7 +34,10 @@ "apiVersion": "extensions/v1beta1", "metadata": { "name": "client", - "creationTimestamp": null + "creationTimestamp": null, + "labels": { + "io.kompose.service": "client" + } }, "spec": { "replicas": 1, diff --git a/script/test/fixtures/tty-true/output-k8s.json b/script/test/fixtures/tty-true/output-k8s.json index 07bef7f2..7d363af8 100644 --- a/script/test/fixtures/tty-true/output-k8s.json +++ b/script/test/fixtures/tty-true/output-k8s.json @@ -34,7 +34,10 @@ "apiVersion": "extensions/v1beta1", "metadata": { "name": "client", - "creationTimestamp": null + "creationTimestamp": null, + "labels": { + "io.kompose.service": "client" + } }, "spec": { "replicas": 1, diff --git a/script/test/fixtures/volume-mounts/simple-vol-mounts/output-k8s.json b/script/test/fixtures/volume-mounts/simple-vol-mounts/output-k8s.json index 9d4bd7cc..4968cf09 100644 --- a/script/test/fixtures/volume-mounts/simple-vol-mounts/output-k8s.json +++ b/script/test/fixtures/volume-mounts/simple-vol-mounts/output-k8s.json @@ -34,7 +34,10 @@ "apiVersion": "extensions/v1beta1", "metadata": { "name": "httpd", - "creationTimestamp": null + "creationTimestamp": null, + "labels": { + "io.kompose.service": "httpd" + } }, "spec": { "replicas": 1, diff --git a/script/test/fixtures/volume-mounts/volumes-from/output-k8s.json b/script/test/fixtures/volume-mounts/volumes-from/output-k8s.json index cd1fd90c..3fa7a774 100644 --- a/script/test/fixtures/volume-mounts/volumes-from/output-k8s.json +++ b/script/test/fixtures/volume-mounts/volumes-from/output-k8s.json @@ -60,7 +60,10 @@ "apiVersion": "extensions/v1beta1", "metadata": { "name": "nginx", - "creationTimestamp": null + "creationTimestamp": null, + "labels": { + "io.kompose.service": "nginx" + } }, "spec": { "replicas": 1, @@ -144,7 +147,10 @@ "apiVersion": "extensions/v1beta1", "metadata": { "name": "web", - "creationTimestamp": null + "creationTimestamp": null, + "labels": { + "io.kompose.service": "web" + } }, "spec": { "replicas": 1, diff --git a/script/test/fixtures/yaml-and-yml/output-k8s.json b/script/test/fixtures/yaml-and-yml/output-k8s.json index 167b0c19..fce4a9f3 100644 --- a/script/test/fixtures/yaml-and-yml/output-k8s.json +++ b/script/test/fixtures/yaml-and-yml/output-k8s.json @@ -60,7 +60,10 @@ "apiVersion": "extensions/v1beta1", "metadata": { "name": "redis", - "creationTimestamp": null + "creationTimestamp": null, + "labels": { + "io.kompose.service": "redis" + } }, "spec": { "replicas": 1, @@ -96,7 +99,10 @@ "apiVersion": "extensions/v1beta1", "metadata": { "name": "web", - "creationTimestamp": null + "creationTimestamp": null, + "labels": { + "io.kompose.service": "web" + } }, "spec": { "replicas": 1, diff --git a/script/test/fixtures/yaml-and-yml/yml/output-k8s.json b/script/test/fixtures/yaml-and-yml/yml/output-k8s.json index 167b0c19..fce4a9f3 100644 --- a/script/test/fixtures/yaml-and-yml/yml/output-k8s.json +++ b/script/test/fixtures/yaml-and-yml/yml/output-k8s.json @@ -60,7 +60,10 @@ "apiVersion": "extensions/v1beta1", "metadata": { "name": "redis", - "creationTimestamp": null + "creationTimestamp": null, + "labels": { + "io.kompose.service": "redis" + } }, "spec": { "replicas": 1, @@ -96,7 +99,10 @@ "apiVersion": "extensions/v1beta1", "metadata": { "name": "web", - "creationTimestamp": null + "creationTimestamp": null, + "labels": { + "io.kompose.service": "web" + } }, "spec": { "replicas": 1,