From bc28ffc675bc2e9ebaa16094e2bf5b26ad5a8511 Mon Sep 17 00:00:00 2001 From: Hang Yan Date: Thu, 26 Dec 2019 16:36:11 +0800 Subject: [PATCH] Upgrade deployment/daemonset to apps/v1 (#1207) --- pkg/transformer/kubernetes/k8sutils.go | 69 +- pkg/transformer/kubernetes/kubernetes.go | 5 +- pkg/transformer/kubernetes/kubernetes_test.go | 67 ++ pkg/transformer/openshift/openshift.go | 1 + script/test/cmd/tests.sh | 3 +- .../test/fixtures/bundles/dab/output-k8s.json | 4 +- .../test/fixtures/bundles/dsb/output-k8s.json | 10 +- .../output-k8s-empty-vols-template.json | 93 ++- .../change-in-volume/output-k8s-template.json | 97 ++- .../output-k8s-config-long-warning.json | 57 +- .../output-k8s-config-long.json | 57 +- .../output-k8s-config-short-warning.json | 36 +- .../output-k8s-config-short.json | 36 +- .../output-k8s-endpoint-mode-1.json | 36 +- .../output-k8s-endpoint-mode-2.json | 36 +- .../output-os-config-long.json | 2 +- .../output-os-config-short.json | 2 +- .../compose-v3.3-test/output-os-mode-1.json | 2 +- .../configmap/output-k8s-template.json | 56 +- .../output-k8s-controller-template.json | 77 +- .../output-k8s-controller-v3-template.json | 77 +- .../output-k8s-daemonset-template.json | 100 +-- .../output-k8s-deployment-template.json | 140 ++-- ...output-k8s-global-deployment-template.json | 36 +- .../output-k8s-global-template.json | 25 +- .../controller/output-k8s-rc-template.json | 8 +- .../output-os-controller-v3-template.json | 29 +- script/test/fixtures/domain/output-k8s.json | 38 +- .../output-k8s-template.json | 46 +- script/test/fixtures/env/output-k8s.json | 121 +-- script/test/fixtures/env/output-os.json | 2 +- .../output-k8s-template.json | 774 ++++++++++-------- .../etherpad/output-k8s-template.json | 117 +-- .../fixtures/examples/output-counter-k8s.json | 72 +- .../examples/output-counter-v3-k8s.json | 78 +- .../fixtures/examples/output-gitlab-k8s.json | 210 ++--- script/test/fixtures/examples/output-k8s.json | 6 +- .../test/fixtures/examples/output-v3-k8s.json | 138 ++-- .../fixtures/examples/output-voting-k8s.json | 184 +++-- ...rnetes-expose-hostname-multiple-ports.json | 80 +- .../kubernetes-expose-hostname-tls.json | 84 +- .../kubernetes-expose-hostname.json | 80 +- ...bernetes-expose-multiple-hostname-tls.json | 84 +- .../kubernetes-expose-multiple-hostname.json | 80 +- ...kubernetes-expose-true-multiple-ports.json | 80 +- .../kubernetes-expose-true.json | 80 +- .../fixtures/gitlab/output-k8s-template.json | 144 ++-- .../test/fixtures/group-add/output-k8s.json | 36 +- .../healthcheck/output-k8s-template.json | 46 +- .../output-only-command-k8s-template.json | 42 +- .../kubernetes-v12-image-pull-policy.json | 41 +- .../kubernetes-v3-image-pull-policy.json | 123 +-- .../kubernetes-image-pull-secret.json | 138 ++-- .../keyonly-envs/output-k8s-template.json | 156 ++-- .../mem-limit/output-k8s-template.json | 36 +- .../mem-limit/output-mb-k8s-template.json | 36 +- .../output-base-template.json | 38 +- .../output-compose-new-service-template.json | 72 +- .../output-compose-port-template.json | 36 +- .../output-openshift-template.json | 2 +- .../output-other-toplevel-merge-template.json | 154 ++-- ...tput-other-toplevel-override-template.json | 77 +- .../output-k8s-template.json | 145 ++-- script/test/fixtures/network/output-k8s.json | 38 +- .../output-k8s-template-v3.json | 180 ++-- .../nginx-node-redis/output-k8s-template.json | 180 ++-- .../placement/output-k8s-array-template.json | 38 +- .../placement/output-k8s-template.json | 38 +- .../ports-with-ip/output-k8s-template.json | 72 +- .../fixtures/ports-with-ip/output-k8s.json | 12 +- .../ports-with-proto/output-k8s-template.json | 72 +- .../output-k8s-restart-unless-stopped.json | 38 +- .../output-os-restart-unless-stopped.json | 2 +- .../output-k8s-template.json | 72 +- .../fixtures/secrets/output-long-k8s.json | 65 +- .../fixtures/secrets/output-short-k8s.json | 77 +- .../output-k8s-template.json | 168 ++-- .../stdin-true/output-k8s-template.json | 36 +- script/test/fixtures/stdin/output-k8s.json | 36 +- script/test/fixtures/stdin/output.json | 2 +- .../tty-true/output-k8s-template.json | 36 +- .../v3/output-deploy-mode-k8s-template.json | 27 +- .../v3/output-deploy-mode-os-template.json | 27 +- script/test/fixtures/v3/output-env-k8s.json | 40 +- script/test/fixtures/v3/output-env-subs.json | 41 +- script/test/fixtures/v3/output-k8s-3.5.json | 38 +- .../fixtures/v3/output-k8s-full-example.json | 56 +- .../test/fixtures/v3/output-k8s-template.json | 134 +-- .../test/fixtures/v3/output-memcpu-k8s.json | 38 +- .../v3/output-memcpu-partial-k8s.json | 38 +- .../fixtures/v3/output-unset-env-k8s.json | 48 +- .../v3/output-volumes-k8s-template.json | 65 +- .../hostpath/output-k8s-template.json | 57 +- .../named-volume/output-k8s-template.json | 59 +- .../named-volume/output-k8s-v3.json | 83 +- .../output-k8s-template.json | 57 +- .../tmpfs/output-k8s-template.json | 55 +- .../volumes-from/output-k8s-case.json | 6 +- .../volumes-from/output-k8s-template.json | 140 ++-- .../yaml-and-yml/output-k8s-template.json | 72 +- .../yaml-and-yml/yml/output-k8s-template.json | 72 +- 101 files changed, 4186 insertions(+), 2966 deletions(-) diff --git a/pkg/transformer/kubernetes/k8sutils.go b/pkg/transformer/kubernetes/k8sutils.go index 7e550afd..20e9805a 100644 --- a/pkg/transformer/kubernetes/k8sutils.go +++ b/pkg/transformer/kubernetes/k8sutils.go @@ -225,14 +225,28 @@ func PrintList(objects []runtime.Object, opt kobject.ConvertOptions) error { return err } - val := reflect.ValueOf(v).Elem() - // Use reflect to access TypeMeta struct inside runtime.Object. - // cast it to correct type - unversioned.TypeMeta - typeMeta := val.FieldByName("TypeMeta").Interface().(unversioned.TypeMeta) + var typeMeta unversioned.TypeMeta + var objectMeta api.ObjectMeta - // Use reflect to access ObjectMeta struct inside runtime.Object. - // cast it to correct type - api.ObjectMeta - objectMeta := val.FieldByName("ObjectMeta").Interface().(api.ObjectMeta) + if us, ok := v.(*runtime.Unstructured); ok { + typeMeta = unversioned.TypeMeta{ + Kind: us.GetKind(), + APIVersion: us.GetAPIVersion(), + } + objectMeta = api.ObjectMeta{ + Name: us.GetName(), + } + } else { + val := reflect.ValueOf(v).Elem() + // Use reflect to access TypeMeta struct inside runtime.Object. + // cast it to correct type - unversioned.TypeMeta + typeMeta = val.FieldByName("TypeMeta").Interface().(unversioned.TypeMeta) + + // Use reflect to access ObjectMeta struct inside runtime.Object. + // cast it to correct type - api.ObjectMeta + objectMeta = val.FieldByName("ObjectMeta").Interface().(api.ObjectMeta) + + } file, err = transformer.Print(objectMeta.Name, finalDirName, strings.ToLower(typeMeta.Kind), data, opt.ToStdout, opt.GenerateJSON, f, opt.Provider) if err != nil { @@ -269,6 +283,11 @@ func marshal(obj runtime.Object, jsonFormat bool) (data []byte, err error) { // if groupVersion is empty (unversioned.GroupVersion{}), use version from original object (obj) func convertToVersion(obj runtime.Object, groupVersion unversioned.GroupVersion) (runtime.Object, error) { + // ignore unstruct object + if _, ok := obj.(*runtime.Unstructured); ok { + return obj, nil + } + var version unversioned.GroupVersion if groupVersion.Empty() { @@ -605,6 +624,42 @@ func (k *Kubernetes) RemoveDupObjects(objs *[]runtime.Object) { *objs = result } +func resetWorkloadApiVersion(d runtime.Object) runtime.Object { + data, err := json.Marshal(d) + if err == nil { + var us runtime.Unstructured + if err := json.Unmarshal(data, &us); err == nil { + us.SetGroupVersionKind(unversioned.GroupVersionKind{ + Group: "apps", + Version: "v1", + Kind: d.GetObjectKind().GroupVersionKind().Kind, + }) + return &us + } else { + return d + } + } else { + return d + } +} + +// FixWorkloadVersion force reset deployment/daemonset's apiversion to apps/v1 +func (k *Kubernetes) FixWorkloadVersion(objs *[]runtime.Object) { + var result []runtime.Object + for _, obj := range *objs { + if d, ok := obj.(*extensions.Deployment); ok { + nd := resetWorkloadApiVersion(d) + result = append(result, nd) + } else if d, ok := obj.(*extensions.DaemonSet); ok { + nd := resetWorkloadApiVersion(d) + result = append(result, nd) + } else { + result = append(result, obj) + } + } + *objs = result +} + // SortedKeys Ensure the kubernetes objects are in a consistent order func SortedKeys(komposeObject kobject.KomposeObject) []string { var sortedKeys []string diff --git a/pkg/transformer/kubernetes/kubernetes.go b/pkg/transformer/kubernetes/kubernetes.go index 980a47ea..d4287902 100755 --- a/pkg/transformer/kubernetes/kubernetes.go +++ b/pkg/transformer/kubernetes/kubernetes.go @@ -311,7 +311,9 @@ func (k *Kubernetes) InitD(name string, service kobject.ServiceConfig, replicas }, Spec: extensions.DeploymentSpec{ Replicas: int32(replicas), - + Selector: &unversioned.LabelSelector{ + MatchLabels: transformer.ConfigLabels(name), + }, Template: api.PodTemplateSpec{ ObjectMeta: api.ObjectMeta{ //Labels: transformer.ConfigLabels(name), @@ -1098,6 +1100,7 @@ func (k *Kubernetes) Transform(komposeObject kobject.KomposeObject, opt kobject. // sort all object so Services are first k.SortServicesFirst(&allobjects) k.RemoveDupObjects(&allobjects) + k.FixWorkloadVersion(&allobjects) return allobjects, nil } diff --git a/pkg/transformer/kubernetes/kubernetes_test.go b/pkg/transformer/kubernetes/kubernetes_test.go index 1a3391c9..8e1b04c8 100644 --- a/pkg/transformer/kubernetes/kubernetes_test.go +++ b/pkg/transformer/kubernetes/kubernetes_test.go @@ -17,7 +17,10 @@ limitations under the License. package kubernetes import ( + "encoding/json" "fmt" + "k8s.io/kubernetes/pkg/api/unversioned" + "k8s.io/kubernetes/pkg/runtime" "reflect" "testing" @@ -343,6 +346,43 @@ func TestKomposeConvert(t *testing.T) { } foundD = true } + + if u, ok := obj.(*runtime.Unstructured); ok { + if u.GetKind() == "Deployment" { + u.SetGroupVersionKind(unversioned.GroupVersionKind{ + Group: "extensions", + Version: "v1beta1", + Kind: "Deployment", + }) + data, err := json.Marshal(u) + if err != nil { + t.Errorf("%v", err) + } + var d extensions.Deployment + if err := json.Unmarshal(data, &d); err == nil { + if err := checkPodTemplate(config, d.Spec.Template, labelsWithNetwork); err != nil { + t.Errorf("%v", err) + } + if err := checkMeta(config, d.ObjectMeta, name, true); err != nil { + t.Errorf("%v", err) + } + if test.opt.IsReplicaSetFlag { + if (int)(d.Spec.Replicas) != replicas { + t.Errorf("Expected %d replicas, got %d", replicas, d.Spec.Replicas) + } + } else { + + if (int)(d.Spec.Replicas) != newServiceConfig().Replicas { + t.Errorf("Expected %d replicas, got %d", newServiceConfig().Replicas, d.Spec.Replicas) + + } + } + foundD = true + } + + } + } + } if test.opt.CreateDS { if ds, ok := obj.(*extensions.DaemonSet); ok { @@ -357,6 +397,33 @@ func TestKomposeConvert(t *testing.T) { } foundDS = true } + + if u, ok := obj.(*runtime.Unstructured); ok { + if u.GetKind() == "DaemonSet" { + u.SetGroupVersionKind(unversioned.GroupVersionKind{ + Group: "extensions", + Version: "v1beta1", + Kind: "DaemonSet", + }) + data, err := json.Marshal(u) + if err != nil { + t.Errorf("%v", err) + } + var ds extensions.DaemonSet + if err := json.Unmarshal(data, &ds); err == nil { + if err := checkPodTemplate(config, ds.Spec.Template, labelsWithNetwork); err != nil { + t.Errorf("%v", err) + } + if err := checkMeta(config, ds.ObjectMeta, name, true); err != nil { + t.Errorf("%v", err) + } + foundDS = true + } + + } + + } + } if test.opt.CreateRC { if rc, ok := obj.(*api.ReplicationController); ok { diff --git a/pkg/transformer/openshift/openshift.go b/pkg/transformer/openshift/openshift.go index 54788ee6..c2a8dafb 100644 --- a/pkg/transformer/openshift/openshift.go +++ b/pkg/transformer/openshift/openshift.go @@ -428,6 +428,7 @@ func (o *OpenShift) Transform(komposeObject kobject.KomposeObject, opt kobject.C // sort all object so Services are first o.SortServicesFirst(&allobjects) o.RemoveDupObjects(&allobjects) + o.FixWorkloadVersion(&allobjects) return allobjects, nil } diff --git a/script/test/cmd/tests.sh b/script/test/cmd/tests.sh index 5adc7ef7..780ff7c1 100755 --- a/script/test/cmd/tests.sh +++ b/script/test/cmd/tests.sh @@ -75,9 +75,7 @@ cmd="kompose -f $KOMPOSE_ROOT/script/test/fixtures/nginx-node-redis/docker-compo sed -e "s;%VERSION%;$version;g" -e "s;%CMD%;$cmd;g" $KOMPOSE_ROOT/script/test/fixtures/nginx-node-redis/output-k8s-template.json > /tmp/output-k8s.json convert::expect_success "$cmd" "/tmp/output-k8s.json" - # openshift test - # Replacing variables with current branch and uri # Test BuildConfig cmd="kompose --provider=openshift -f $KOMPOSE_ROOT/script/test/fixtures/nginx-node-redis/docker-compose.yml convert --stdout -j --build build-config" @@ -642,6 +640,7 @@ convert::expect_success "$cmd" "/tmp/output-k8s.json" # Test environment variables substitution +unset foo cmd="kompose convert --stdout -j -f $KOMPOSE_ROOT/script/test/fixtures/v3/docker-compose-env-subs.yaml" sed -e "s;%VERSION%;$version;g" -e "s;%CMD%;$cmd;g" $KOMPOSE_ROOT/script/test/fixtures/v3/output-env-subs.json > /tmp/output-k8s.json convert::expect_success "$cmd" "/tmp/output-k8s.json" diff --git a/script/test/fixtures/bundles/dab/output-k8s.json b/script/test/fixtures/bundles/dab/output-k8s.json index f0a75e36..e2917fce 100644 --- a/script/test/fixtures/bundles/dab/output-k8s.json +++ b/script/test/fixtures/bundles/dab/output-k8s.json @@ -57,7 +57,7 @@ }, { "kind": "Deployment", - "apiVersion": "extensions/v1beta1", + "apiVersion": "apps/v1", "metadata": { "name": "redis", "creationTimestamp": null, @@ -96,7 +96,7 @@ }, { "kind": "Deployment", - "apiVersion": "extensions/v1beta1", + "apiVersion": "apps/v1", "metadata": { "name": "web", "creationTimestamp": null, diff --git a/script/test/fixtures/bundles/dsb/output-k8s.json b/script/test/fixtures/bundles/dsb/output-k8s.json index 499b1659..4622d917 100644 --- a/script/test/fixtures/bundles/dsb/output-k8s.json +++ b/script/test/fixtures/bundles/dsb/output-k8s.json @@ -142,7 +142,7 @@ }, { "kind": "Deployment", - "apiVersion": "extensions/v1beta1", + "apiVersion": "apps/v1", "metadata": { "name": "db", "creationTimestamp": null, @@ -184,7 +184,7 @@ }, { "kind": "Deployment", - "apiVersion": "extensions/v1beta1", + "apiVersion": "apps/v1", "metadata": { "name": "redis", "creationTimestamp": null, @@ -223,7 +223,7 @@ }, { "kind": "Deployment", - "apiVersion": "extensions/v1beta1", + "apiVersion": "apps/v1", "metadata": { "name": "result", "creationTimestamp": null, @@ -262,7 +262,7 @@ }, { "kind": "Deployment", - "apiVersion": "extensions/v1beta1", + "apiVersion": "apps/v1", "metadata": { "name": "vote", "creationTimestamp": null, @@ -304,7 +304,7 @@ }, { "kind": "Deployment", - "apiVersion": "extensions/v1beta1", + "apiVersion": "apps/v1", "metadata": { "name": "worker", "creationTimestamp": null, diff --git a/script/test/fixtures/change-in-volume/output-k8s-empty-vols-template.json b/script/test/fixtures/change-in-volume/output-k8s-empty-vols-template.json index fac5a3a2..6829305f 100644 --- a/script/test/fixtures/change-in-volume/output-k8s-empty-vols-template.json +++ b/script/test/fixtures/change-in-volume/output-k8s-empty-vols-template.json @@ -66,91 +66,102 @@ } }, { + "apiVersion": "apps/v1", "kind": "Deployment", - "apiVersion": "extensions/v1beta1", "metadata": { - "name": "redis", - "creationTimestamp": null, - "labels": { - "io.kompose.service": "redis" - }, "annotations": { "kompose.cmd": "%CMD%", "kompose.service.type": "headless", "kompose.version": "%VERSION%" - } + }, + "creationTimestamp": null, + "labels": { + "io.kompose.service": "redis" + }, + "name": "redis" }, "spec": { "replicas": 1, + "selector": { + "matchLabels": { + "io.kompose.service": "redis" + } + }, + "strategy": {}, "template": { "metadata": { - "creationTimestamp": null, - "labels": { - "io.kompose.service": "redis" - }, "annotations": { "kompose.cmd": "%CMD%", "kompose.service.type": "headless", "kompose.version": "%VERSION%" + }, + "creationTimestamp": null, + "labels": { + "io.kompose.service": "redis" } }, "spec": { "containers": [ { - "name": "redis", "image": "redis", + "imagePullPolicy": "", + "name": "redis", "resources": {} } ], - "restartPolicy": "Always" + "restartPolicy": "Always", + "serviceAccountName": "", + "volumes": null } - }, - "strategy": {} + } }, "status": {} }, { + "apiVersion": "apps/v1", "kind": "Deployment", - "apiVersion": "extensions/v1beta1", "metadata": { - "name": "web", + "annotations": { + "kompose.cmd": "%CMD%", + "kompose.version": "%VERSION%" + }, "creationTimestamp": null, "labels": { "io.kompose.service": "web" }, - "annotations": { - "kompose.cmd": "%CMD%", - "kompose.version": "%VERSION%" - } + "name": "web" }, "spec": { "replicas": 1, + "selector": { + "matchLabels": { + "io.kompose.service": "web" + } + }, + "strategy": { + "type": "Recreate" + }, "template": { "metadata": { - "creationTimestamp": null, - "labels": { - "io.kompose.service": "web" - }, "annotations": { "kompose.cmd": "%CMD%", "kompose.version": "%VERSION%" + }, + "creationTimestamp": null, + "labels": { + "io.kompose.service": "web" } }, "spec": { - "volumes": [ - { - "name": "web-empty0", - "emptyDir": {} - } - ], "containers": [ { - "name": "web", - "image": "flask_web", "args": [ "python", "app.py" ], + "image": "flask_web", + "imagePullPolicy": "", + "name": "web", "ports": [ { "containerPort": 5000 @@ -159,17 +170,21 @@ "resources": {}, "volumeMounts": [ { - "name": "web-empty0", - "mountPath": "/code" + "mountPath": "/code", + "name": "web-empty0" } ] } ], - "restartPolicy": "Always" + "restartPolicy": "Always", + "serviceAccountName": "", + "volumes": [ + { + "emptyDir": {}, + "name": "web-empty0" + } + ] } - }, - "strategy": { - "type": "Recreate" } }, "status": {} diff --git a/script/test/fixtures/change-in-volume/output-k8s-template.json b/script/test/fixtures/change-in-volume/output-k8s-template.json index 817ecef8..1447ce7c 100644 --- a/script/test/fixtures/change-in-volume/output-k8s-template.json +++ b/script/test/fixtures/change-in-volume/output-k8s-template.json @@ -66,93 +66,102 @@ } }, { + "apiVersion": "apps/v1", "kind": "Deployment", - "apiVersion": "extensions/v1beta1", "metadata": { - "name": "redis", - "creationTimestamp": null, - "labels": { - "io.kompose.service": "redis" - }, "annotations": { "kompose.cmd": "%CMD%", "kompose.service.type": "headless", "kompose.version": "%VERSION%" - } + }, + "creationTimestamp": null, + "labels": { + "io.kompose.service": "redis" + }, + "name": "redis" }, "spec": { "replicas": 1, + "selector": { + "matchLabels": { + "io.kompose.service": "redis" + } + }, + "strategy": {}, "template": { "metadata": { - "creationTimestamp": null, - "labels": { - "io.kompose.service": "redis" - }, "annotations": { "kompose.cmd": "%CMD%", "kompose.service.type": "headless", "kompose.version": "%VERSION%" + }, + "creationTimestamp": null, + "labels": { + "io.kompose.service": "redis" } }, "spec": { "containers": [ { - "name": "redis", "image": "redis", + "imagePullPolicy": "", + "name": "redis", "resources": {} } ], - "restartPolicy": "Always" + "restartPolicy": "Always", + "serviceAccountName": "", + "volumes": null } - }, - "strategy": {} + } }, "status": {} }, { + "apiVersion": "apps/v1", "kind": "Deployment", - "apiVersion": "extensions/v1beta1", "metadata": { - "name": "web", + "annotations": { + "kompose.cmd": "%CMD%", + "kompose.version": "%VERSION%" + }, "creationTimestamp": null, "labels": { "io.kompose.service": "web" }, - "annotations": { - "kompose.cmd": "%CMD%", - "kompose.version": "%VERSION%" - } + "name": "web" }, "spec": { "replicas": 1, + "selector": { + "matchLabels": { + "io.kompose.service": "web" + } + }, + "strategy": { + "type": "Recreate" + }, "template": { "metadata": { - "creationTimestamp": null, - "labels": { - "io.kompose.service": "web" - }, "annotations": { "kompose.cmd": "%CMD%", "kompose.version": "%VERSION%" + }, + "creationTimestamp": null, + "labels": { + "io.kompose.service": "web" } }, "spec": { - "volumes": [ - { - "name": "web-claim0", - "persistentVolumeClaim": { - "claimName": "web-claim0" - } - } - ], "containers": [ { - "name": "web", - "image": "flask_web", "args": [ "python", "app.py" ], + "image": "flask_web", + "imagePullPolicy": "", + "name": "web", "ports": [ { "containerPort": 5000 @@ -161,17 +170,23 @@ "resources": {}, "volumeMounts": [ { - "name": "web-claim0", - "mountPath": "/code" + "mountPath": "/code", + "name": "web-claim0" } ] } ], - "restartPolicy": "Always" + "restartPolicy": "Always", + "serviceAccountName": "", + "volumes": [ + { + "name": "web-claim0", + "persistentVolumeClaim": { + "claimName": "web-claim0" + } + } + ] } - }, - "strategy": { - "type": "Recreate" } }, "status": {} diff --git a/script/test/fixtures/compose-v3.3-test/output-k8s-config-long-warning.json b/script/test/fixtures/compose-v3.3-test/output-k8s-config-long-warning.json index cf131fb5..0722d29c 100644 --- a/script/test/fixtures/compose-v3.3-test/output-k8s-config-long-warning.json +++ b/script/test/fixtures/compose-v3.3-test/output-k8s-config-long-warning.json @@ -18,59 +18,66 @@ } }, { + "apiVersion": "apps/v1", "kind": "Deployment", - "apiVersion": "extensions/v1beta1", "metadata": { - "name": "redis", + "annotations": { + "kompose.cmd": "%CMD%", + "kompose.version": "%VERSION%" + }, "creationTimestamp": null, "labels": { "io.kompose.service": "redis" }, - "annotations": { - "kompose.cmd": "%CMD%", - "kompose.version": "%VERSION%" - } + "name": "redis" }, "spec": { "replicas": 1, + "selector": { + "matchLabels": { + "io.kompose.service": "redis" + } + }, + "strategy": {}, "template": { "metadata": { - "creationTimestamp": null, - "labels": { - "io.kompose.service": "redis" - }, "annotations": { "kompose.cmd": "%CMD%", "kompose.version": "%VERSION%" + }, + "creationTimestamp": null, + "labels": { + "io.kompose.service": "redis" } }, "spec": { - "volumes": [ - { - "name": "my-config", - "configMap": { - "name": "my-config", - "defaultMode": 288 - } - } - ], "containers": [ { - "name": "redis", "image": "redis:latest", + "imagePullPolicy": "", + "name": "redis", "resources": {}, "volumeMounts": [ { - "name": "my-config", - "mountPath": "/redis-config" + "mountPath": "/redis-config", + "name": "my-config" } ] } ], - "restartPolicy": "Always" + "restartPolicy": "Always", + "serviceAccountName": "", + "volumes": [ + { + "configMap": { + "Name": "my-config", + "defaultMode": 288 + }, + "name": "my-config" + } + ] } - }, - "strategy": {} + } }, "status": {} } diff --git a/script/test/fixtures/compose-v3.3-test/output-k8s-config-long.json b/script/test/fixtures/compose-v3.3-test/output-k8s-config-long.json index cf131fb5..0722d29c 100644 --- a/script/test/fixtures/compose-v3.3-test/output-k8s-config-long.json +++ b/script/test/fixtures/compose-v3.3-test/output-k8s-config-long.json @@ -18,59 +18,66 @@ } }, { + "apiVersion": "apps/v1", "kind": "Deployment", - "apiVersion": "extensions/v1beta1", "metadata": { - "name": "redis", + "annotations": { + "kompose.cmd": "%CMD%", + "kompose.version": "%VERSION%" + }, "creationTimestamp": null, "labels": { "io.kompose.service": "redis" }, - "annotations": { - "kompose.cmd": "%CMD%", - "kompose.version": "%VERSION%" - } + "name": "redis" }, "spec": { "replicas": 1, + "selector": { + "matchLabels": { + "io.kompose.service": "redis" + } + }, + "strategy": {}, "template": { "metadata": { - "creationTimestamp": null, - "labels": { - "io.kompose.service": "redis" - }, "annotations": { "kompose.cmd": "%CMD%", "kompose.version": "%VERSION%" + }, + "creationTimestamp": null, + "labels": { + "io.kompose.service": "redis" } }, "spec": { - "volumes": [ - { - "name": "my-config", - "configMap": { - "name": "my-config", - "defaultMode": 288 - } - } - ], "containers": [ { - "name": "redis", "image": "redis:latest", + "imagePullPolicy": "", + "name": "redis", "resources": {}, "volumeMounts": [ { - "name": "my-config", - "mountPath": "/redis-config" + "mountPath": "/redis-config", + "name": "my-config" } ] } ], - "restartPolicy": "Always" + "restartPolicy": "Always", + "serviceAccountName": "", + "volumes": [ + { + "configMap": { + "Name": "my-config", + "defaultMode": 288 + }, + "name": "my-config" + } + ] } - }, - "strategy": {} + } }, "status": {} } diff --git a/script/test/fixtures/compose-v3.3-test/output-k8s-config-short-warning.json b/script/test/fixtures/compose-v3.3-test/output-k8s-config-short-warning.json index 61f93ac3..50c5c71e 100644 --- a/script/test/fixtures/compose-v3.3-test/output-k8s-config-short-warning.json +++ b/script/test/fixtures/compose-v3.3-test/output-k8s-config-short-warning.json @@ -18,44 +18,52 @@ } }, { + "apiVersion": "apps/v1", "kind": "Deployment", - "apiVersion": "extensions/v1beta1", "metadata": { - "name": "redis", + "annotations": { + "kompose.cmd": "%CMD%", + "kompose.version": "%VERSION%" + }, "creationTimestamp": null, "labels": { "io.kompose.service": "redis" }, - "annotations": { - "kompose.cmd": "%CMD%", - "kompose.version": "%VERSION%" - } + "name": "redis" }, "spec": { "replicas": 1, + "selector": { + "matchLabels": { + "io.kompose.service": "redis" + } + }, + "strategy": {}, "template": { "metadata": { - "creationTimestamp": null, - "labels": { - "io.kompose.service": "redis" - }, "annotations": { "kompose.cmd": "%CMD%", "kompose.version": "%VERSION%" + }, + "creationTimestamp": null, + "labels": { + "io.kompose.service": "redis" } }, "spec": { "containers": [ { - "name": "redis", "image": "redis:latest", + "imagePullPolicy": "", + "name": "redis", "resources": {} } ], - "restartPolicy": "Always" + "restartPolicy": "Always", + "serviceAccountName": "", + "volumes": null } - }, - "strategy": {} + } }, "status": {} } diff --git a/script/test/fixtures/compose-v3.3-test/output-k8s-config-short.json b/script/test/fixtures/compose-v3.3-test/output-k8s-config-short.json index 61f93ac3..50c5c71e 100644 --- a/script/test/fixtures/compose-v3.3-test/output-k8s-config-short.json +++ b/script/test/fixtures/compose-v3.3-test/output-k8s-config-short.json @@ -18,44 +18,52 @@ } }, { + "apiVersion": "apps/v1", "kind": "Deployment", - "apiVersion": "extensions/v1beta1", "metadata": { - "name": "redis", + "annotations": { + "kompose.cmd": "%CMD%", + "kompose.version": "%VERSION%" + }, "creationTimestamp": null, "labels": { "io.kompose.service": "redis" }, - "annotations": { - "kompose.cmd": "%CMD%", - "kompose.version": "%VERSION%" - } + "name": "redis" }, "spec": { "replicas": 1, + "selector": { + "matchLabels": { + "io.kompose.service": "redis" + } + }, + "strategy": {}, "template": { "metadata": { - "creationTimestamp": null, - "labels": { - "io.kompose.service": "redis" - }, "annotations": { "kompose.cmd": "%CMD%", "kompose.version": "%VERSION%" + }, + "creationTimestamp": null, + "labels": { + "io.kompose.service": "redis" } }, "spec": { "containers": [ { - "name": "redis", "image": "redis:latest", + "imagePullPolicy": "", + "name": "redis", "resources": {} } ], - "restartPolicy": "Always" + "restartPolicy": "Always", + "serviceAccountName": "", + "volumes": null } - }, - "strategy": {} + } }, "status": {} } diff --git a/script/test/fixtures/compose-v3.3-test/output-k8s-endpoint-mode-1.json b/script/test/fixtures/compose-v3.3-test/output-k8s-endpoint-mode-1.json index 984a309e..46a30594 100644 --- a/script/test/fixtures/compose-v3.3-test/output-k8s-endpoint-mode-1.json +++ b/script/test/fixtures/compose-v3.3-test/output-k8s-endpoint-mode-1.json @@ -35,37 +35,44 @@ } }, { + "apiVersion": "apps/v1", "kind": "Deployment", - "apiVersion": "extensions/v1beta1", "metadata": { - "name": "wordpress", + "annotations": { + "kompose.cmd": "%CMD%", + "kompose.version": "%VERSION%" + }, "creationTimestamp": null, "labels": { "io.kompose.service": "wordpress" }, - "annotations": { - "kompose.cmd": "%CMD%", - "kompose.version": "%VERSION%" - } + "name": "wordpress" }, "spec": { "replicas": 2, + "selector": { + "matchLabels": { + "io.kompose.service": "wordpress" + } + }, + "strategy": {}, "template": { "metadata": { - "creationTimestamp": null, - "labels": { - "io.kompose.service": "wordpress" - }, "annotations": { "kompose.cmd": "%CMD%", "kompose.version": "%VERSION%" + }, + "creationTimestamp": null, + "labels": { + "io.kompose.service": "wordpress" } }, "spec": { "containers": [ { - "name": "wordpress", "image": "wordpress", + "imagePullPolicy": "", + "name": "wordpress", "ports": [ { "containerPort": 80 @@ -74,10 +81,11 @@ "resources": {} } ], - "restartPolicy": "Always" + "restartPolicy": "Always", + "serviceAccountName": "", + "volumes": null } - }, - "strategy": {} + } }, "status": {} } diff --git a/script/test/fixtures/compose-v3.3-test/output-k8s-endpoint-mode-2.json b/script/test/fixtures/compose-v3.3-test/output-k8s-endpoint-mode-2.json index 5440327e..e040750e 100644 --- a/script/test/fixtures/compose-v3.3-test/output-k8s-endpoint-mode-2.json +++ b/script/test/fixtures/compose-v3.3-test/output-k8s-endpoint-mode-2.json @@ -34,37 +34,44 @@ } }, { + "apiVersion": "apps/v1", "kind": "Deployment", - "apiVersion": "extensions/v1beta1", "metadata": { - "name": "wordpress", + "annotations": { + "kompose.cmd": "%CMD%", + "kompose.version": "%VERSION%" + }, "creationTimestamp": null, "labels": { "io.kompose.service": "wordpress" }, - "annotations": { - "kompose.cmd": "%CMD%", - "kompose.version": "%VERSION%" - } + "name": "wordpress" }, "spec": { "replicas": 2, + "selector": { + "matchLabels": { + "io.kompose.service": "wordpress" + } + }, + "strategy": {}, "template": { "metadata": { - "creationTimestamp": null, - "labels": { - "io.kompose.service": "wordpress" - }, "annotations": { "kompose.cmd": "%CMD%", "kompose.version": "%VERSION%" + }, + "creationTimestamp": null, + "labels": { + "io.kompose.service": "wordpress" } }, "spec": { "containers": [ { - "name": "wordpress", "image": "wordpress", + "imagePullPolicy": "", + "name": "wordpress", "ports": [ { "containerPort": 80 @@ -73,10 +80,11 @@ "resources": {} } ], - "restartPolicy": "Always" + "restartPolicy": "Always", + "serviceAccountName": "", + "volumes": null } - }, - "strategy": {} + } }, "status": {} } diff --git a/script/test/fixtures/compose-v3.3-test/output-os-config-long.json b/script/test/fixtures/compose-v3.3-test/output-os-config-long.json index 0a90c918..de47f093 100644 --- a/script/test/fixtures/compose-v3.3-test/output-os-config-long.json +++ b/script/test/fixtures/compose-v3.3-test/output-os-config-long.json @@ -123,4 +123,4 @@ } } ] -} \ No newline at end of file +} diff --git a/script/test/fixtures/compose-v3.3-test/output-os-config-short.json b/script/test/fixtures/compose-v3.3-test/output-os-config-short.json index 3edbaa06..15bd6c52 100644 --- a/script/test/fixtures/compose-v3.3-test/output-os-config-short.json +++ b/script/test/fixtures/compose-v3.3-test/output-os-config-short.json @@ -108,4 +108,4 @@ } } ] -} \ No newline at end of file +} diff --git a/script/test/fixtures/compose-v3.3-test/output-os-mode-1.json b/script/test/fixtures/compose-v3.3-test/output-os-mode-1.json index 18b8e2ce..f1c8084c 100644 --- a/script/test/fixtures/compose-v3.3-test/output-os-mode-1.json +++ b/script/test/fixtures/compose-v3.3-test/output-os-mode-1.json @@ -130,4 +130,4 @@ } } ] -} \ No newline at end of file +} diff --git a/script/test/fixtures/configmap/output-k8s-template.json b/script/test/fixtures/configmap/output-k8s-template.json index 0b531ee2..e4ce0b43 100644 --- a/script/test/fixtures/configmap/output-k8s-template.json +++ b/script/test/fixtures/configmap/output-k8s-template.json @@ -36,50 +36,49 @@ } }, { + "apiVersion": "apps/v1", "kind": "Deployment", - "apiVersion": "extensions/v1beta1", "metadata": { - "name": "redis", - "creationTimestamp": null, - "labels": { - "io.kompose.service": "redis" - }, "annotations": { "kompose.cmd": "%CMD%", "kompose.service.type": "nodeport", "kompose.version": "%VERSION%" - } + }, + "creationTimestamp": null, + "labels": { + "io.kompose.service": "redis" + }, + "name": "redis" }, "spec": { "replicas": 1, + "selector": { + "matchLabels": { + "io.kompose.service": "redis" + } + }, + "strategy": {}, "template": { "metadata": { - "creationTimestamp": null, - "labels": { - "io.kompose.service": "redis" - }, "annotations": { "kompose.cmd": "%CMD%", "kompose.service.type": "nodeport", "kompose.version": "%VERSION%" + }, + "creationTimestamp": null, + "labels": { + "io.kompose.service": "redis" } }, "spec": { "containers": [ { - "name": "redis", - "image": "bitnami/redis:latest", - "ports": [ - { - "containerPort": 6379 - } - ], "env": [ { "name": "ALLOW_EMPTY_PASSWORD", "valueFrom": { "configMapKeyRef": { - "name": "foo-env", + "Name": "foo-env", "key": "ALLOW_EMPTY_PASSWORD" } } @@ -88,7 +87,7 @@ "name": "BAR", "valueFrom": { "configMapKeyRef": { - "name": "bar-env", + "Name": "bar-env", "key": "BAR" } } @@ -97,19 +96,28 @@ "name": "FOO", "valueFrom": { "configMapKeyRef": { - "name": "bar-env", + "Name": "bar-env", "key": "FOO" } } } ], + "image": "bitnami/redis:latest", + "imagePullPolicy": "", + "name": "redis", + "ports": [ + { + "containerPort": 6379 + } + ], "resources": {} } ], - "restartPolicy": "Always" + "restartPolicy": "Always", + "serviceAccountName": "", + "volumes": null } - }, - "strategy": {} + } }, "status": {} }, diff --git a/script/test/fixtures/controller/output-k8s-controller-template.json b/script/test/fixtures/controller/output-k8s-controller-template.json index 1b7ecb14..6160426f 100644 --- a/script/test/fixtures/controller/output-k8s-controller-template.json +++ b/script/test/fixtures/controller/output-k8s-controller-template.json @@ -34,20 +34,20 @@ } }, { + "apiVersion": "apps/v1", "kind": "DaemonSet", - "apiVersion": "extensions/v1beta1", "metadata": { - "name": "db", + "annotations": { + "kompose.cmd": "%CMD%", + "kompose.controller.type": "daemonset", + "kompose.version": "%VERSION%", + "project.logs": "/var/log/mysql" + }, "creationTimestamp": null, "labels": { "io.kompose.service": "db" }, - "annotations": { - "kompose.cmd": "%CMD%", - "kompose.version": "%VERSION%", - "kompose.controller.type": "daemonset", - "project.logs": "/var/log/mysql" - } + "name": "db" }, "spec": { "template": { @@ -60,64 +60,66 @@ "spec": { "containers": [ { - "name": "db", - "image": "mysql:5.7", "env": [ { "name": "MYSQL_ROOT_PASSWORD", "value": "password" } ], + "image": "mysql:5.7", + "imagePullPolicy": "", + "name": "db", "resources": {} } ], - "restartPolicy": "Always" + "restartPolicy": "Always", + "serviceAccountName": "", + "volumes": null } } }, "status": { "currentNumberScheduled": 0, - "numberMisscheduled": 0, - "desiredNumberScheduled": 0 + "desiredNumberScheduled": 0, + "numberMisscheduled": 0 } }, { + "apiVersion": "apps/v1", "kind": "Deployment", - "apiVersion": "extensions/v1beta1", "metadata": { - "name": "web", + "annotations": { + "kompose.cmd": "%CMD%", + "kompose.version": "%VERSION%" + }, "creationTimestamp": null, "labels": { "io.kompose.service": "web" }, - "annotations": { - "kompose.cmd": "%CMD%", - "kompose.version": "%VERSION%" - } + "name": "web" }, "spec": { "replicas": 1, + "selector": { + "matchLabels": { + "io.kompose.service": "web" + } + }, + "strategy": {}, "template": { "metadata": { - "creationTimestamp": null, - "labels": { - "io.kompose.service": "web" - }, "annotations": { "kompose.cmd": "%CMD%", "kompose.version": "%VERSION%" + }, + "creationTimestamp": null, + "labels": { + "io.kompose.service": "web" } }, "spec": { "containers": [ { - "name": "web", - "image": "wordpress:4.5", - "ports": [ - { - "containerPort": 80 - } - ], "env": [ { "name": "WORDPRESS_AUTH_KEY", @@ -156,13 +158,22 @@ "value": "changeme" } ], + "image": "wordpress:4.5", + "imagePullPolicy": "", + "name": "web", + "ports": [ + { + "containerPort": 80 + } + ], "resources": {} } ], - "restartPolicy": "Always" + "restartPolicy": "Always", + "serviceAccountName": "", + "volumes": null } - }, - "strategy": {} + } }, "status": {} } diff --git a/script/test/fixtures/controller/output-k8s-controller-v3-template.json b/script/test/fixtures/controller/output-k8s-controller-v3-template.json index 8cbb8922..771ce30e 100644 --- a/script/test/fixtures/controller/output-k8s-controller-v3-template.json +++ b/script/test/fixtures/controller/output-k8s-controller-v3-template.json @@ -35,19 +35,19 @@ } }, { + "apiVersion": "apps/v1", "kind": "DaemonSet", - "apiVersion": "extensions/v1beta1", "metadata": { - "name": "mysql", + "annotations": { + "kompose.cmd": "%CMD%", + "kompose.controller.type": "daemonset", + "kompose.version": "%VERSION%" + }, "creationTimestamp": null, "labels": { "io.kompose.service": "mysql" }, - "annotations": { - "kompose.cmd": "%CMD%", - "kompose.version": "%VERSION%", - "kompose.controller.type": "daemonset" - } + "name": "mysql" }, "spec": { "template": { @@ -60,66 +60,68 @@ "spec": { "containers": [ { - "name": "mysql", - "image": "mysql:5.7", "env": [ { "name": "MYSQL_ROOT_PASSWORD", "value": "password" } ], + "image": "mysql:5.7", + "imagePullPolicy": "", + "name": "mysql", "resources": {} } ], - "restartPolicy": "Always" + "restartPolicy": "Always", + "serviceAccountName": "", + "volumes": null } } }, "status": { "currentNumberScheduled": 0, - "numberMisscheduled": 0, - "desiredNumberScheduled": 0 + "desiredNumberScheduled": 0, + "numberMisscheduled": 0 } }, { + "apiVersion": "apps/v1", "kind": "Deployment", - "apiVersion": "extensions/v1beta1", "metadata": { - "name": "web", - "creationTimestamp": null, - "labels": { - "io.kompose.service": "web" - }, "annotations": { "kompose.cmd": "%CMD%", "kompose.version": "%VERSION%", "port": "wordpress" - } + }, + "creationTimestamp": null, + "labels": { + "io.kompose.service": "web" + }, + "name": "web" }, "spec": { "replicas": 3, + "selector": { + "matchLabels": { + "io.kompose.service": "web" + } + }, + "strategy": {}, "template": { "metadata": { - "creationTimestamp": null, - "labels": { - "io.kompose.service": "web" - }, "annotations": { "kompose.cmd": "%CMD%", "kompose.version": "%VERSION%", "port": "wordpress" + }, + "creationTimestamp": null, + "labels": { + "io.kompose.service": "web" } }, "spec": { "containers": [ { - "name": "web", - "image": "wordpress:4", - "ports": [ - { - "containerPort": 80 - } - ], "env": [ { "name": "WORDPRESS_AUTH_KEY", @@ -162,13 +164,22 @@ "value": "changeme" } ], + "image": "wordpress:4", + "imagePullPolicy": "", + "name": "web", + "ports": [ + { + "containerPort": 80 + } + ], "resources": {} } ], - "restartPolicy": "Always" + "restartPolicy": "Always", + "serviceAccountName": "", + "volumes": null } - }, - "strategy": {} + } }, "status": {} } diff --git a/script/test/fixtures/controller/output-k8s-daemonset-template.json b/script/test/fixtures/controller/output-k8s-daemonset-template.json index 77ad63d0..ffcaf0c5 100644 --- a/script/test/fixtures/controller/output-k8s-daemonset-template.json +++ b/script/test/fixtures/controller/output-k8s-daemonset-template.json @@ -14,8 +14,8 @@ }, "annotations": { "kompose.cmd": "%CMD%", - "kompose.version": "%VERSION%", - "kompose.service.type": "LoadBalancer" + "kompose.service.type": "LoadBalancer", + "kompose.version": "%VERSION%" } }, "spec": { @@ -96,20 +96,19 @@ } }, { + "apiVersion": "apps/v1", "kind": "DaemonSet", - "apiVersion": "extensions/v1beta1", "metadata": { - "name": "frontend", + "annotations": { + "kompose.cmd": "%CMD%", + "kompose.service.type": "LoadBalancer", + "kompose.version": "%VERSION%" + }, "creationTimestamp": null, "labels": { "io.kompose.service": "frontend" }, - "annotations": { - "kompose.cmd": "%CMD%", - "kompose.version": "%VERSION%", - "kompose.service.type": "LoadBalancer" - - } + "name": "frontend" }, "spec": { "template": { @@ -122,45 +121,48 @@ "spec": { "containers": [ { - "name": "frontend", - "image": "gcr.io/google-samples/gb-frontend:v4", - "ports": [ - { - "containerPort": 80 - } - ], "env": [ { "name": "GET_HOSTS_FROM", "value": "dns" } ], + "image": "gcr.io/google-samples/gb-frontend:v4", + "imagePullPolicy": "", + "name": "frontend", + "ports": [ + { + "containerPort": 80 + } + ], "resources": {} } ], - "restartPolicy": "Always" + "restartPolicy": "Always", + "serviceAccountName": "", + "volumes": null } } }, "status": { "currentNumberScheduled": 0, - "numberMisscheduled": 0, - "desiredNumberScheduled": 0 + "desiredNumberScheduled": 0, + "numberMisscheduled": 0 } }, { + "apiVersion": "apps/v1", "kind": "DaemonSet", - "apiVersion": "extensions/v1beta1", "metadata": { - "name": "redis-master", + "annotations": { + "kompose.cmd": "%CMD%", + "kompose.version": "%VERSION%" + }, "creationTimestamp": null, "labels": { "io.kompose.service": "redis-master" }, - "annotations": { - "kompose.cmd": "%CMD%", - "kompose.version": "%VERSION%" - } + "name": "redis-master" }, "spec": { "template": { @@ -173,8 +175,9 @@ "spec": { "containers": [ { - "name": "redis-master", "image": "k8s.gcr.io/redis:e2e", + "imagePullPolicy": "", + "name": "redis-master", "ports": [ { "containerPort": 6379 @@ -183,29 +186,31 @@ "resources": {} } ], - "restartPolicy": "Always" + "restartPolicy": "Always", + "serviceAccountName": "", + "volumes": null } } }, "status": { "currentNumberScheduled": 0, - "numberMisscheduled": 0, - "desiredNumberScheduled": 0 + "desiredNumberScheduled": 0, + "numberMisscheduled": 0 } }, { + "apiVersion": "apps/v1", "kind": "DaemonSet", - "apiVersion": "extensions/v1beta1", "metadata": { - "name": "redis-slave", + "annotations": { + "kompose.cmd": "%CMD%", + "kompose.version": "%VERSION%" + }, "creationTimestamp": null, "labels": { "io.kompose.service": "redis-slave" }, - "annotations": { - "kompose.cmd": "%CMD%", - "kompose.version": "%VERSION%" - } + "name": "redis-slave" }, "spec": { "template": { @@ -218,30 +223,33 @@ "spec": { "containers": [ { - "name": "redis-slave", - "image": "gcr.io/google_samples/gb-redisslave:v1", - "ports": [ - { - "containerPort": 6379 - } - ], "env": [ { "name": "GET_HOSTS_FROM", "value": "dns" } ], + "image": "gcr.io/google_samples/gb-redisslave:v1", + "imagePullPolicy": "", + "name": "redis-slave", + "ports": [ + { + "containerPort": 6379 + } + ], "resources": {} } ], - "restartPolicy": "Always" + "restartPolicy": "Always", + "serviceAccountName": "", + "volumes": null } } }, "status": { "currentNumberScheduled": 0, - "numberMisscheduled": 0, - "desiredNumberScheduled": 0 + "desiredNumberScheduled": 0, + "numberMisscheduled": 0 } } ] diff --git a/script/test/fixtures/controller/output-k8s-deployment-template.json b/script/test/fixtures/controller/output-k8s-deployment-template.json index 36f30c1b..4502c4e0 100644 --- a/script/test/fixtures/controller/output-k8s-deployment-template.json +++ b/script/test/fixtures/controller/output-k8s-deployment-template.json @@ -14,8 +14,8 @@ }, "annotations": { "kompose.cmd": "%CMD%", - "kompose.version": "%VERSION%", - "kompose.service.type": "LoadBalancer" + "kompose.service.type": "LoadBalancer", + "kompose.version": "%VERSION%" } }, "spec": { @@ -96,92 +96,107 @@ } }, { + "apiVersion": "apps/v1", "kind": "Deployment", - "apiVersion": "extensions/v1beta1", "metadata": { - "name": "frontend", + "annotations": { + "kompose.cmd": "%CMD%", + "kompose.service.type": "LoadBalancer", + "kompose.version": "%VERSION%" + }, "creationTimestamp": null, "labels": { "io.kompose.service": "frontend" }, - "annotations": { - "kompose.cmd": "%CMD%", - "kompose.version": "%VERSION%", - "kompose.service.type": "LoadBalancer" - } + "name": "frontend" }, "spec": { "replicas": 1, + "selector": { + "matchLabels": { + "io.kompose.service": "frontend" + } + }, + "strategy": {}, "template": { "metadata": { + "annotations": { + "kompose.cmd": "%CMD%", + "kompose.service.type": "LoadBalancer", + "kompose.version": "%VERSION%" + }, "creationTimestamp": null, "labels": { "io.kompose.service": "frontend" - }, - "annotations": { - "kompose.cmd": "%CMD%", - "kompose.version": "%VERSION%", - "kompose.service.type": "LoadBalancer" } }, "spec": { "containers": [ { - "name": "frontend", + "env": [ + { + "name": "GET_HOSTS_FROM", + "value": "dns" + } + ], "image": "gcr.io/google-samples/gb-frontend:v4", + "imagePullPolicy": "", + "name": "frontend", "ports": [ { "containerPort": 80 } ], - "env": [ - { - "name": "GET_HOSTS_FROM", - "value": "dns" - } - ], "resources": {} } ], - "restartPolicy": "Always" + "restartPolicy": "Always", + "serviceAccountName": "", + "volumes": null } - }, - "strategy": {} + } }, "status": {} }, { + "apiVersion": "apps/v1", "kind": "Deployment", - "apiVersion": "extensions/v1beta1", "metadata": { - "name": "redis-master", + "annotations": { + "kompose.cmd": "%CMD%", + "kompose.version": "%VERSION%" + }, "creationTimestamp": null, "labels": { "io.kompose.service": "redis-master" }, - "annotations": { - "kompose.cmd": "%CMD%", - "kompose.version": "%VERSION%" - } + "name": "redis-master" }, "spec": { "replicas": 1, + "selector": { + "matchLabels": { + "io.kompose.service": "redis-master" + } + }, + "strategy": {}, "template": { "metadata": { - "creationTimestamp": null, - "labels": { - "io.kompose.service": "redis-master" - }, "annotations": { "kompose.cmd": "%CMD%", "kompose.version": "%VERSION%" + }, + "creationTimestamp": null, + "labels": { + "io.kompose.service": "redis-master" } }, "spec": { "containers": [ { - "name": "redis-master", "image": "k8s.gcr.io/redis:e2e", + "imagePullPolicy": "", + "name": "redis-master", "ports": [ { "containerPort": 6379 @@ -190,63 +205,72 @@ "resources": {} } ], - "restartPolicy": "Always" + "restartPolicy": "Always", + "serviceAccountName": "", + "volumes": null } - }, - "strategy": {} + } }, "status": {} }, { + "apiVersion": "apps/v1", "kind": "Deployment", - "apiVersion": "extensions/v1beta1", "metadata": { - "name": "redis-slave", + "annotations": { + "kompose.cmd": "%CMD%", + "kompose.version": "%VERSION%" + }, "creationTimestamp": null, "labels": { "io.kompose.service": "redis-slave" }, - "annotations": { - "kompose.cmd": "%CMD%", - "kompose.version": "%VERSION%" - } + "name": "redis-slave" }, "spec": { "replicas": 1, + "selector": { + "matchLabels": { + "io.kompose.service": "redis-slave" + } + }, + "strategy": {}, "template": { "metadata": { - "creationTimestamp": null, - "labels": { - "io.kompose.service": "redis-slave" - }, "annotations": { "kompose.cmd": "%CMD%", "kompose.version": "%VERSION%" + }, + "creationTimestamp": null, + "labels": { + "io.kompose.service": "redis-slave" } }, "spec": { "containers": [ { - "name": "redis-slave", - "image": "gcr.io/google_samples/gb-redisslave:v1", - "ports": [ - { - "containerPort": 6379 - } - ], "env": [ { "name": "GET_HOSTS_FROM", "value": "dns" } ], + "image": "gcr.io/google_samples/gb-redisslave:v1", + "imagePullPolicy": "", + "name": "redis-slave", + "ports": [ + { + "containerPort": 6379 + } + ], "resources": {} } ], - "restartPolicy": "Always" + "restartPolicy": "Always", + "serviceAccountName": "", + "volumes": null } - }, - "strategy": {} + } }, "status": {} } diff --git a/script/test/fixtures/controller/output-k8s-global-deployment-template.json b/script/test/fixtures/controller/output-k8s-global-deployment-template.json index d92f7b8d..be9e3c05 100644 --- a/script/test/fixtures/controller/output-k8s-global-deployment-template.json +++ b/script/test/fixtures/controller/output-k8s-global-deployment-template.json @@ -4,44 +4,52 @@ "metadata": {}, "items": [ { + "apiVersion": "apps/v1", "kind": "Deployment", - "apiVersion": "extensions/v1beta1", "metadata": { - "name": "worker", + "annotations": { + "kompose.cmd": "%CMD%", + "kompose.version": "%VERSION%" + }, "creationTimestamp": null, "labels": { "io.kompose.service": "worker" }, - "annotations": { - "kompose.cmd": "%CMD%", - "kompose.version": "%VERSION%" - } + "name": "worker" }, "spec": { "replicas": 1, + "selector": { + "matchLabels": { + "io.kompose.service": "worker" + } + }, + "strategy": {}, "template": { "metadata": { - "creationTimestamp": null, - "labels": { - "io.kompose.service": "worker" - }, "annotations": { "kompose.cmd": "%CMD%", "kompose.version": "%VERSION%" + }, + "creationTimestamp": null, + "labels": { + "io.kompose.service": "worker" } }, "spec": { "containers": [ { - "name": "worker", "image": "dockersamples/examplevotingapp_worker", + "imagePullPolicy": "", + "name": "worker", "resources": {} } ], - "restartPolicy": "Always" + "restartPolicy": "Always", + "serviceAccountName": "", + "volumes": null } - }, - "strategy": {} + } }, "status": {} } diff --git a/script/test/fixtures/controller/output-k8s-global-template.json b/script/test/fixtures/controller/output-k8s-global-template.json index d3c59890..fe964d48 100644 --- a/script/test/fixtures/controller/output-k8s-global-template.json +++ b/script/test/fixtures/controller/output-k8s-global-template.json @@ -4,18 +4,18 @@ "metadata": {}, "items": [ { + "apiVersion": "apps/v1", "kind": "DaemonSet", - "apiVersion": "extensions/v1beta1", "metadata": { - "name": "worker", + "annotations": { + "kompose.cmd": "%CMD%", + "kompose.version": "%VERSION%" + }, "creationTimestamp": null, "labels": { "io.kompose.service": "worker" }, - "annotations": { - "kompose.cmd": "%CMD%", - "kompose.version": "%VERSION%" - } + "name": "worker" }, "spec": { "template": { @@ -28,20 +28,23 @@ "spec": { "containers": [ { - "name": "worker", "image": "dockersamples/examplevotingapp_worker", + "imagePullPolicy": "", + "name": "worker", "resources": {} } ], - "restartPolicy": "Always" + "restartPolicy": "Always", + "serviceAccountName": "", + "volumes": null } } }, "status": { "currentNumberScheduled": 0, - "numberMisscheduled": 0, - "desiredNumberScheduled": 0 + "desiredNumberScheduled": 0, + "numberMisscheduled": 0 } } ] -} \ No newline at end of file +} diff --git a/script/test/fixtures/controller/output-k8s-rc-template.json b/script/test/fixtures/controller/output-k8s-rc-template.json index cc250e15..24291a55 100644 --- a/script/test/fixtures/controller/output-k8s-rc-template.json +++ b/script/test/fixtures/controller/output-k8s-rc-template.json @@ -14,8 +14,8 @@ }, "annotations": { "kompose.cmd": "%CMD%", - "kompose.version": "%VERSION%", - "kompose.service.type": "LoadBalancer" + "kompose.service.type": "LoadBalancer", + "kompose.version": "%VERSION%" } }, "spec": { @@ -106,8 +106,8 @@ }, "annotations": { "kompose.cmd": "%CMD%", - "kompose.version": "%VERSION%", - "kompose.service.type": "LoadBalancer" + "kompose.service.type": "LoadBalancer", + "kompose.version": "%VERSION%" } }, "spec": { diff --git a/script/test/fixtures/controller/output-os-controller-v3-template.json b/script/test/fixtures/controller/output-os-controller-v3-template.json index afd53a7e..944f6670 100644 --- a/script/test/fixtures/controller/output-os-controller-v3-template.json +++ b/script/test/fixtures/controller/output-os-controller-v3-template.json @@ -35,19 +35,19 @@ } }, { + "apiVersion": "apps/v1", "kind": "DaemonSet", - "apiVersion": "extensions/v1beta1", "metadata": { - "name": "mysql", - "creationTimestamp": null, - "labels": { - "io.kompose.service": "mysql" - }, "annotations": { "kompose.cmd": "%CMD%", "kompose.controller.type": "daemonset", "kompose.version": "%VERSION%" - } + }, + "creationTimestamp": null, + "labels": { + "io.kompose.service": "mysql" + }, + "name": "mysql" }, "spec": { "template": { @@ -60,25 +60,28 @@ "spec": { "containers": [ { - "name": "mysql", - "image": "mysql:5.7", "env": [ { "name": "MYSQL_ROOT_PASSWORD", "value": "password" } ], + "image": "mysql:5.7", + "imagePullPolicy": "", + "name": "mysql", "resources": {} } ], - "restartPolicy": "Always" + "restartPolicy": "Always", + "serviceAccountName": "", + "volumes": null } } }, "status": { "currentNumberScheduled": 0, - "numberMisscheduled": 0, - "desiredNumberScheduled": 0 + "desiredNumberScheduled": 0, + "numberMisscheduled": 0 } }, { @@ -317,4 +320,4 @@ } } ] -} \ No newline at end of file +} diff --git a/script/test/fixtures/domain/output-k8s.json b/script/test/fixtures/domain/output-k8s.json index 75b60464..fa39dc48 100644 --- a/script/test/fixtures/domain/output-k8s.json +++ b/script/test/fixtures/domain/output-k8s.json @@ -4,46 +4,54 @@ "metadata": {}, "items": [ { + "apiVersion": "apps/v1", "kind": "Deployment", - "apiVersion": "extensions/v1beta1", "metadata": { - "name": "dns", + "annotations": { + "kompose.cmd": "%CMD%", + "kompose.version": "%VERSION%" + }, "creationTimestamp": null, "labels": { "io.kompose.service": "dns" }, - "annotations": { - "kompose.cmd": "%CMD%", - "kompose.version": "%VERSION%" - } + "name": "dns" }, "spec": { "replicas": 1, + "selector": { + "matchLabels": { + "io.kompose.service": "dns" + } + }, + "strategy": {}, "template": { "metadata": { - "creationTimestamp": null, - "labels": { - "io.kompose.service": "dns" - }, "annotations": { "kompose.cmd": "%CMD%", "kompose.version": "%VERSION%" + }, + "creationTimestamp": null, + "labels": { + "io.kompose.service": "dns" } }, "spec": { "containers": [ { - "name": "dns", "image": "phensley/docker-dns", + "imagePullPolicy": "", + "name": "dns", "resources": {} } ], - "restartPolicy": "Always", "hostname": "affy", - "subdomain": "affy.com" + "restartPolicy": "Always", + "serviceAccountName": "", + "subdomain": "affy.com", + "volumes": null } - }, - "strategy": {} + } }, "status": {} } diff --git a/script/test/fixtures/entrypoint-command/output-k8s-template.json b/script/test/fixtures/entrypoint-command/output-k8s-template.json index 559201ea..6ba7b4b9 100644 --- a/script/test/fixtures/entrypoint-command/output-k8s-template.json +++ b/script/test/fixtures/entrypoint-command/output-k8s-template.json @@ -36,52 +36,60 @@ } }, { + "apiVersion": "apps/v1", "kind": "Deployment", - "apiVersion": "extensions/v1beta1", "metadata": { - "name": "base", - "creationTimestamp": null, - "labels": { - "io.kompose.service": "base" - }, "annotations": { "kompose.cmd": "%CMD%", "kompose.service.type": "headless", "kompose.version": "%VERSION%" - } + }, + "creationTimestamp": null, + "labels": { + "io.kompose.service": "base" + }, + "name": "base" }, "spec": { "replicas": 1, + "selector": { + "matchLabels": { + "io.kompose.service": "base" + } + }, + "strategy": {}, "template": { "metadata": { - "creationTimestamp": null, - "labels": { - "io.kompose.service": "base" - }, "annotations": { "kompose.cmd": "%CMD%", "kompose.service.type": "headless", "kompose.version": "%VERSION%" + }, + "creationTimestamp": null, + "labels": { + "io.kompose.service": "base" } }, "spec": { "containers": [ { - "name": "base", - "image": "busybox", - "command": [ - "echo" - ], "args": [ "foo" ], + "command": [ + "echo" + ], + "image": "busybox", + "imagePullPolicy": "", + "name": "base", "resources": {} } ], - "restartPolicy": "Always" + "restartPolicy": "Always", + "serviceAccountName": "", + "volumes": null } - }, - "strategy": {} + } }, "status": {} } diff --git a/script/test/fixtures/env/output-k8s.json b/script/test/fixtures/env/output-k8s.json index 27ffd45c..9786852f 100644 --- a/script/test/fixtures/env/output-k8s.json +++ b/script/test/fixtures/env/output-k8s.json @@ -39,43 +39,47 @@ } }, { + "apiVersion": "apps/v1", "kind": "Deployment", - "apiVersion": "extensions/v1beta1", "metadata": { - "name": "another-namenode", + "annotations": { + "kompose.cmd": "%CMD%", + "kompose.version": "%VERSION%" + }, "creationTimestamp": null, "labels": { "io.kompose.service": "another-namenode" }, - "annotations": { - "kompose.cmd": "%CMD%", - "kompose.version": "%VERSION%" - } + "name": "another-namenode" }, "spec": { "replicas": 1, + "selector": { + "matchLabels": { + "io.kompose.service": "another-namenode" + } + }, + "strategy": {}, "template": { "metadata": { - "creationTimestamp": null, - "labels": { - "io.kompose.service": "another-namenode" - }, "annotations": { "kompose.cmd": "%CMD%", "kompose.version": "%VERSION%" + }, + "creationTimestamp": null, + "labels": { + "io.kompose.service": "another-namenode" } }, "spec": { "containers": [ { - "name": "another-namenode", - "image": "bde2020/hadoop-namenode:2.0.0-hadoop2.7.4-java8", "env": [ { "name": "BAR", "valueFrom": { "configMapKeyRef": { - "name": "hadoop-hive-namenode-env", + "Name": "hadoop-hive-namenode-env", "key": "BAR" } } @@ -84,19 +88,23 @@ "name": "FOO", "valueFrom": { "configMapKeyRef": { - "name": "hadoop-hive-namenode-env", + "Name": "hadoop-hive-namenode-env", "key": "FOO" } } } ], + "image": "bde2020/hadoop-namenode:2.0.0-hadoop2.7.4-java8", + "imagePullPolicy": "", + "name": "another-namenode", "resources": {} } ], - "restartPolicy": "Always" + "restartPolicy": "Always", + "serviceAccountName": "", + "volumes": null } - }, - "strategy": {} + } }, "status": {} }, @@ -116,59 +124,49 @@ } }, { + "apiVersion": "apps/v1", "kind": "Deployment", - "apiVersion": "extensions/v1beta1", "metadata": { - "name": "namenode", + "annotations": { + "kompose.cmd": "%CMD%", + "kompose.version": "%VERSION%" + }, "creationTimestamp": null, "labels": { "io.kompose.service": "namenode" }, - "annotations": { - "kompose.cmd": "%CMD%", - "kompose.version": "%VERSION%" - } + "name": "namenode" }, "spec": { "replicas": 1, + "selector": { + "matchLabels": { + "io.kompose.service": "namenode" + } + }, + "strategy": { + "type": "Recreate" + }, "template": { "metadata": { - "creationTimestamp": null, - "labels": { - "io.kompose.service": "namenode" - }, "annotations": { "kompose.cmd": "%CMD%", "kompose.version": "%VERSION%" + }, + "creationTimestamp": null, + "labels": { + "io.kompose.service": "namenode" } }, "spec": { - "volumes": [ - { - "name": "namenode", - "persistentVolumeClaim": { - "claimName": "namenode" - } - } - ], "containers": [ { - "name": "namenode", - "image": "bde2020/hadoop-namenode:2.0.0-hadoop2.7.4-java8", - "ports": [ - { - "containerPort": 50070 - }, - { - "containerPort": 8020 - } - ], "env": [ { "name": "BAR", "valueFrom": { "configMapKeyRef": { - "name": "hadoop-hive-namenode-env", + "Name": "hadoop-hive-namenode-env", "key": "BAR" } } @@ -181,26 +179,43 @@ "name": "FOO", "valueFrom": { "configMapKeyRef": { - "name": "hadoop-hive-namenode-env", + "Name": "hadoop-hive-namenode-env", "key": "FOO" } } } ], + "image": "bde2020/hadoop-namenode:2.0.0-hadoop2.7.4-java8", + "imagePullPolicy": "", + "name": "namenode", + "ports": [ + { + "containerPort": 50070 + }, + { + "containerPort": 8020 + } + ], "resources": {}, "volumeMounts": [ { - "name": "namenode", - "mountPath": "/hadoop/dfs/name" + "mountPath": "/hadoop/dfs/name", + "name": "namenode" } ] } ], - "restartPolicy": "Always" + "restartPolicy": "Always", + "serviceAccountName": "", + "volumes": [ + { + "name": "namenode", + "persistentVolumeClaim": { + "claimName": "namenode" + } + } + ] } - }, - "strategy": { - "type": "Recreate" } }, "status": {} diff --git a/script/test/fixtures/env/output-os.json b/script/test/fixtures/env/output-os.json index db0694ef..f8a0e176 100644 --- a/script/test/fixtures/env/output-os.json +++ b/script/test/fixtures/env/output-os.json @@ -323,4 +323,4 @@ "status": {} } ] -} \ No newline at end of file +} diff --git a/script/test/fixtures/envvars-separators/output-k8s-template.json b/script/test/fixtures/envvars-separators/output-k8s-template.json index f6017613..bae25aa8 100644 --- a/script/test/fixtures/envvars-separators/output-k8s-template.json +++ b/script/test/fixtures/envvars-separators/output-k8s-template.json @@ -94,45 +94,46 @@ } }, { + "apiVersion": "apps/v1", "kind": "Deployment", - "apiVersion": "extensions/v1beta1", "metadata": { - "name": "hygieia-api", + "annotations": { + "kompose.cmd": "%CMD%", + "kompose.version": "%VERSION%" + }, "creationTimestamp": null, "labels": { "io.kompose.service": "hygieia-api" }, - "annotations": { - "kompose.cmd": "%CMD%", - "kompose.version": "%VERSION%" - } + "name": "hygieia-api" }, "spec": { "replicas": 1, + "selector": { + "matchLabels": { + "io.kompose.service": "hygieia-api" + } + }, + "strategy": { + "type": "Recreate" + }, "template": { "metadata": { - "creationTimestamp": null, - "labels": { - "io.kompose.service": "hygieia-api" - }, "annotations": { "kompose.cmd": "%CMD%", "kompose.version": "%VERSION%" + }, + "creationTimestamp": null, + "labels": { + "io.kompose.service": "hygieia-api" } }, "spec": { - "volumes": [ - { - "name": "hygieia-api-claim0", - "persistentVolumeClaim": { - "claimName": "hygieia-api-claim0" - } - } - ], "containers": [ { - "name": "hygieia-api", "image": "hygieia-api:latest", + "imagePullPolicy": "", + "name": "hygieia-api", "ports": [ { "containerPort": 8080 @@ -141,17 +142,23 @@ "resources": {}, "volumeMounts": [ { - "name": "hygieia-api-claim0", - "mountPath": "/hygieia/logs" + "mountPath": "/hygieia/logs", + "name": "hygieia-api-claim0" } ] } ], - "restartPolicy": "Always" + "restartPolicy": "Always", + "serviceAccountName": "", + "volumes": [ + { + "name": "hygieia-api-claim0", + "persistentVolumeClaim": { + "claimName": "hygieia-api-claim0" + } + } + ] } - }, - "strategy": { - "type": "Recreate" } }, "status": {} @@ -179,33 +186,57 @@ "status": {} }, { + "apiVersion": "apps/v1", "kind": "Deployment", - "apiVersion": "extensions/v1beta1", "metadata": { - "name": "hygieia-bitbucket-scm-collector", + "annotations": { + "kompose.cmd": "%CMD%", + "kompose.version": "%VERSION%" + }, "creationTimestamp": null, "labels": { "io.kompose.service": "hygieia-bitbucket-scm-collector" }, - "annotations": { - "kompose.cmd": "%CMD%", - "kompose.version": "%VERSION%" - } + "name": "hygieia-bitbucket-scm-collector" }, "spec": { "replicas": 1, + "selector": { + "matchLabels": { + "io.kompose.service": "hygieia-bitbucket-scm-collector" + } + }, + "strategy": { + "type": "Recreate" + }, "template": { "metadata": { - "creationTimestamp": null, - "labels": { - "io.kompose.service": "hygieia-bitbucket-scm-collector" - }, "annotations": { "kompose.cmd": "%CMD%", "kompose.version": "%VERSION%" + }, + "creationTimestamp": null, + "labels": { + "io.kompose.service": "hygieia-bitbucket-scm-collector" } }, "spec": { + "containers": [ + { + "image": "hygieia-bitbucket-scm-collector:latest", + "imagePullPolicy": "", + "name": "hygieia-bitbucket", + "resources": {}, + "volumeMounts": [ + { + "mountPath": "/hygieia/logs", + "name": "hygieia-bitbucket-scm-collector-claim0" + } + ] + } + ], + "restartPolicy": "Always", + "serviceAccountName": "", "volumes": [ { "name": "hygieia-bitbucket-scm-collector-claim0", @@ -213,25 +244,8 @@ "claimName": "hygieia-bitbucket-scm-collector-claim0" } } - ], - "containers": [ - { - "name": "hygieia-bitbucket", - "image": "hygieia-bitbucket-scm-collector:latest", - "resources": {}, - "volumeMounts": [ - { - "name": "hygieia-bitbucket-scm-collector-claim0", - "mountPath": "/hygieia/logs" - } - ] - } - ], - "restartPolicy": "Always" + ] } - }, - "strategy": { - "type": "Recreate" } }, "status": {} @@ -259,33 +273,57 @@ "status": {} }, { + "apiVersion": "apps/v1", "kind": "Deployment", - "apiVersion": "extensions/v1beta1", "metadata": { - "name": "hygieia-chat-ops-collector", + "annotations": { + "kompose.cmd": "%CMD%", + "kompose.version": "%VERSION%" + }, "creationTimestamp": null, "labels": { "io.kompose.service": "hygieia-chat-ops-collector" }, - "annotations": { - "kompose.cmd": "%CMD%", - "kompose.version": "%VERSION%" - } + "name": "hygieia-chat-ops-collector" }, "spec": { "replicas": 1, + "selector": { + "matchLabels": { + "io.kompose.service": "hygieia-chat-ops-collector" + } + }, + "strategy": { + "type": "Recreate" + }, "template": { "metadata": { - "creationTimestamp": null, - "labels": { - "io.kompose.service": "hygieia-chat-ops-collector" - }, "annotations": { "kompose.cmd": "%CMD%", "kompose.version": "%VERSION%" + }, + "creationTimestamp": null, + "labels": { + "io.kompose.service": "hygieia-chat-ops-collector" } }, "spec": { + "containers": [ + { + "image": "hygieia-chat-ops-collector:latest", + "imagePullPolicy": "", + "name": "hygieia-chat-ops", + "resources": {}, + "volumeMounts": [ + { + "mountPath": "/hygieia/logs", + "name": "hygieia-chat-ops-collector-claim0" + } + ] + } + ], + "restartPolicy": "Always", + "serviceAccountName": "", "volumes": [ { "name": "hygieia-chat-ops-collector-claim0", @@ -293,25 +331,8 @@ "claimName": "hygieia-chat-ops-collector-claim0" } } - ], - "containers": [ - { - "name": "hygieia-chat-ops", - "image": "hygieia-chat-ops-collector:latest", - "resources": {}, - "volumeMounts": [ - { - "name": "hygieia-chat-ops-collector-claim0", - "mountPath": "/hygieia/logs" - } - ] - } - ], - "restartPolicy": "Always" + ] } - }, - "strategy": { - "type": "Recreate" } }, "status": {} @@ -339,33 +360,57 @@ "status": {} }, { + "apiVersion": "apps/v1", "kind": "Deployment", - "apiVersion": "extensions/v1beta1", "metadata": { - "name": "hygieia-github-scm-collector", + "annotations": { + "kompose.cmd": "%CMD%", + "kompose.version": "%VERSION%" + }, "creationTimestamp": null, "labels": { "io.kompose.service": "hygieia-github-scm-collector" }, - "annotations": { - "kompose.cmd": "%CMD%", - "kompose.version": "%VERSION%" - } + "name": "hygieia-github-scm-collector" }, "spec": { "replicas": 1, + "selector": { + "matchLabels": { + "io.kompose.service": "hygieia-github-scm-collector" + } + }, + "strategy": { + "type": "Recreate" + }, "template": { "metadata": { - "creationTimestamp": null, - "labels": { - "io.kompose.service": "hygieia-github-scm-collector" - }, "annotations": { "kompose.cmd": "%CMD%", "kompose.version": "%VERSION%" + }, + "creationTimestamp": null, + "labels": { + "io.kompose.service": "hygieia-github-scm-collector" } }, "spec": { + "containers": [ + { + "image": "hygieia-github-scm-collector:latest", + "imagePullPolicy": "", + "name": "hygieia-github", + "resources": {}, + "volumeMounts": [ + { + "mountPath": "/hygieia/logs", + "name": "hygieia-github-scm-collector-claim0" + } + ] + } + ], + "restartPolicy": "Always", + "serviceAccountName": "", "volumes": [ { "name": "hygieia-github-scm-collector-claim0", @@ -373,25 +418,8 @@ "claimName": "hygieia-github-scm-collector-claim0" } } - ], - "containers": [ - { - "name": "hygieia-github", - "image": "hygieia-github-scm-collector:latest", - "resources": {}, - "volumeMounts": [ - { - "name": "hygieia-github-scm-collector-claim0", - "mountPath": "/hygieia/logs" - } - ] - } - ], - "restartPolicy": "Always" + ] } - }, - "strategy": { - "type": "Recreate" } }, "status": {} @@ -419,33 +447,57 @@ "status": {} }, { + "apiVersion": "apps/v1", "kind": "Deployment", - "apiVersion": "extensions/v1beta1", "metadata": { - "name": "hygieia-jenkins-build-collector", + "annotations": { + "kompose.cmd": "%CMD%", + "kompose.version": "%VERSION%" + }, "creationTimestamp": null, "labels": { "io.kompose.service": "hygieia-jenkins-build-collector" }, - "annotations": { - "kompose.cmd": "%CMD%", - "kompose.version": "%VERSION%" - } + "name": "hygieia-jenkins-build-collector" }, "spec": { "replicas": 1, + "selector": { + "matchLabels": { + "io.kompose.service": "hygieia-jenkins-build-collector" + } + }, + "strategy": { + "type": "Recreate" + }, "template": { "metadata": { - "creationTimestamp": null, - "labels": { - "io.kompose.service": "hygieia-jenkins-build-collector" - }, "annotations": { "kompose.cmd": "%CMD%", "kompose.version": "%VERSION%" + }, + "creationTimestamp": null, + "labels": { + "io.kompose.service": "hygieia-jenkins-build-collector" } }, "spec": { + "containers": [ + { + "image": "hygieia-jenkins-build-collector:latest", + "imagePullPolicy": "", + "name": "hygieia-jenkins-build", + "resources": {}, + "volumeMounts": [ + { + "mountPath": "/hygieia/logs", + "name": "hygieia-jenkins-build-collector-claim0" + } + ] + } + ], + "restartPolicy": "Always", + "serviceAccountName": "", "volumes": [ { "name": "hygieia-jenkins-build-collector-claim0", @@ -453,25 +505,8 @@ "claimName": "hygieia-jenkins-build-collector-claim0" } } - ], - "containers": [ - { - "name": "hygieia-jenkins-build", - "image": "hygieia-jenkins-build-collector:latest", - "resources": {}, - "volumeMounts": [ - { - "name": "hygieia-jenkins-build-collector-claim0", - "mountPath": "/hygieia/logs" - } - ] - } - ], - "restartPolicy": "Always" + ] } - }, - "strategy": { - "type": "Recreate" } }, "status": {} @@ -499,33 +534,57 @@ "status": {} }, { + "apiVersion": "apps/v1", "kind": "Deployment", - "apiVersion": "extensions/v1beta1", "metadata": { - "name": "hygieia-jenkins-cucumber-test-collector", + "annotations": { + "kompose.cmd": "%CMD%", + "kompose.version": "%VERSION%" + }, "creationTimestamp": null, "labels": { "io.kompose.service": "hygieia-jenkins-cucumber-test-collector" }, - "annotations": { - "kompose.cmd": "%CMD%", - "kompose.version": "%VERSION%" - } + "name": "hygieia-jenkins-cucumber-test-collector" }, "spec": { "replicas": 1, + "selector": { + "matchLabels": { + "io.kompose.service": "hygieia-jenkins-cucumber-test-collector" + } + }, + "strategy": { + "type": "Recreate" + }, "template": { "metadata": { - "creationTimestamp": null, - "labels": { - "io.kompose.service": "hygieia-jenkins-cucumber-test-collector" - }, "annotations": { "kompose.cmd": "%CMD%", "kompose.version": "%VERSION%" + }, + "creationTimestamp": null, + "labels": { + "io.kompose.service": "hygieia-jenkins-cucumber-test-collector" } }, "spec": { + "containers": [ + { + "image": "hygieia-jenkins-cucumber-test-collector:latest", + "imagePullPolicy": "", + "name": "hygieia-jenkins-cucumber", + "resources": {}, + "volumeMounts": [ + { + "mountPath": "/hygieia/logs", + "name": "hygieia-jenkins-cucumber-test-collector-claim0" + } + ] + } + ], + "restartPolicy": "Always", + "serviceAccountName": "", "volumes": [ { "name": "hygieia-jenkins-cucumber-test-collector-claim0", @@ -533,25 +592,8 @@ "claimName": "hygieia-jenkins-cucumber-test-collector-claim0" } } - ], - "containers": [ - { - "name": "hygieia-jenkins-cucumber", - "image": "hygieia-jenkins-cucumber-test-collector:latest", - "resources": {}, - "volumeMounts": [ - { - "name": "hygieia-jenkins-cucumber-test-collector-claim0", - "mountPath": "/hygieia/logs" - } - ] - } - ], - "restartPolicy": "Always" + ] } - }, - "strategy": { - "type": "Recreate" } }, "status": {} @@ -579,45 +621,43 @@ "status": {} }, { + "apiVersion": "apps/v1", "kind": "Deployment", - "apiVersion": "extensions/v1beta1", "metadata": { - "name": "hygieia-jira-feature-collector", + "annotations": { + "kompose.cmd": "%CMD%", + "kompose.version": "%VERSION%" + }, "creationTimestamp": null, "labels": { "io.kompose.service": "hygieia-jira-feature-collector" }, - "annotations": { - "kompose.cmd": "%CMD%", - "kompose.version": "%VERSION%" - } + "name": "hygieia-jira-feature-collector" }, "spec": { "replicas": 1, + "selector": { + "matchLabels": { + "io.kompose.service": "hygieia-jira-feature-collector" + } + }, + "strategy": { + "type": "Recreate" + }, "template": { "metadata": { - "creationTimestamp": null, - "labels": { - "io.kompose.service": "hygieia-jira-feature-collector" - }, "annotations": { "kompose.cmd": "%CMD%", "kompose.version": "%VERSION%" + }, + "creationTimestamp": null, + "labels": { + "io.kompose.service": "hygieia-jira-feature-collector" } }, "spec": { - "volumes": [ - { - "name": "hygieia-jira-feature-collector-claim0", - "persistentVolumeClaim": { - "claimName": "hygieia-jira-feature-collector-claim0" - } - } - ], "containers": [ { - "name": "hygieia-jira", - "image": "hygieia-jira-feature-collector:latest", "env": [ { "name": "JIRA_BASE_URL", @@ -628,20 +668,29 @@ "value": "username:password" } ], + "image": "hygieia-jira-feature-collector:latest", + "imagePullPolicy": "", + "name": "hygieia-jira", "resources": {}, "volumeMounts": [ { - "name": "hygieia-jira-feature-collector-claim0", - "mountPath": "/hygieia/logs" + "mountPath": "/hygieia/logs", + "name": "hygieia-jira-feature-collector-claim0" } ] } ], - "restartPolicy": "Always" + "restartPolicy": "Always", + "serviceAccountName": "", + "volumes": [ + { + "name": "hygieia-jira-feature-collector-claim0", + "persistentVolumeClaim": { + "claimName": "hygieia-jira-feature-collector-claim0" + } + } + ] } - }, - "strategy": { - "type": "Recreate" } }, "status": {} @@ -669,33 +718,57 @@ "status": {} }, { + "apiVersion": "apps/v1", "kind": "Deployment", - "apiVersion": "extensions/v1beta1", "metadata": { - "name": "hygieia-sonar-codequality-collector", + "annotations": { + "kompose.cmd": "%CMD%", + "kompose.version": "%VERSION%" + }, "creationTimestamp": null, "labels": { "io.kompose.service": "hygieia-sonar-codequality-collector" }, - "annotations": { - "kompose.cmd": "%CMD%", - "kompose.version": "%VERSION%" - } + "name": "hygieia-sonar-codequality-collector" }, "spec": { "replicas": 1, + "selector": { + "matchLabels": { + "io.kompose.service": "hygieia-sonar-codequality-collector" + } + }, + "strategy": { + "type": "Recreate" + }, "template": { "metadata": { - "creationTimestamp": null, - "labels": { - "io.kompose.service": "hygieia-sonar-codequality-collector" - }, "annotations": { "kompose.cmd": "%CMD%", "kompose.version": "%VERSION%" + }, + "creationTimestamp": null, + "labels": { + "io.kompose.service": "hygieia-sonar-codequality-collector" } }, "spec": { + "containers": [ + { + "image": "hygieia-sonar-codequality-collector:latest", + "imagePullPolicy": "", + "name": "hygieia-sonar-codequality", + "resources": {}, + "volumeMounts": [ + { + "mountPath": "/hygieia/logs", + "name": "hygieia-sonar-codequality-collector-claim0" + } + ] + } + ], + "restartPolicy": "Always", + "serviceAccountName": "", "volumes": [ { "name": "hygieia-sonar-codequality-collector-claim0", @@ -703,25 +776,8 @@ "claimName": "hygieia-sonar-codequality-collector-claim0" } } - ], - "containers": [ - { - "name": "hygieia-sonar-codequality", - "image": "hygieia-sonar-codequality-collector:latest", - "resources": {}, - "volumeMounts": [ - { - "name": "hygieia-sonar-codequality-collector-claim0", - "mountPath": "/hygieia/logs" - } - ] - } - ], - "restartPolicy": "Always" + ] } - }, - "strategy": { - "type": "Recreate" } }, "status": {} @@ -749,33 +805,57 @@ "status": {} }, { + "apiVersion": "apps/v1", "kind": "Deployment", - "apiVersion": "extensions/v1beta1", "metadata": { - "name": "hygieia-subversion-scm-collector", + "annotations": { + "kompose.cmd": "%CMD%", + "kompose.version": "%VERSION%" + }, "creationTimestamp": null, "labels": { "io.kompose.service": "hygieia-subversion-scm-collector" }, - "annotations": { - "kompose.cmd": "%CMD%", - "kompose.version": "%VERSION%" - } + "name": "hygieia-subversion-scm-collector" }, "spec": { "replicas": 1, + "selector": { + "matchLabels": { + "io.kompose.service": "hygieia-subversion-scm-collector" + } + }, + "strategy": { + "type": "Recreate" + }, "template": { "metadata": { - "creationTimestamp": null, - "labels": { - "io.kompose.service": "hygieia-subversion-scm-collector" - }, "annotations": { "kompose.cmd": "%CMD%", "kompose.version": "%VERSION%" + }, + "creationTimestamp": null, + "labels": { + "io.kompose.service": "hygieia-subversion-scm-collector" } }, "spec": { + "containers": [ + { + "image": "hygieia-subversion-scm-collector:latest", + "imagePullPolicy": "", + "name": "hygieia-subversion", + "resources": {}, + "volumeMounts": [ + { + "mountPath": "/hygieia/logs", + "name": "hygieia-subversion-scm-collector-claim0" + } + ] + } + ], + "restartPolicy": "Always", + "serviceAccountName": "", "volumes": [ { "name": "hygieia-subversion-scm-collector-claim0", @@ -783,25 +863,8 @@ "claimName": "hygieia-subversion-scm-collector-claim0" } } - ], - "containers": [ - { - "name": "hygieia-subversion", - "image": "hygieia-subversion-scm-collector:latest", - "resources": {}, - "volumeMounts": [ - { - "name": "hygieia-subversion-scm-collector-claim0", - "mountPath": "/hygieia/logs" - } - ] - } - ], - "restartPolicy": "Always" + ] } - }, - "strategy": { - "type": "Recreate" } }, "status": {} @@ -829,45 +892,43 @@ "status": {} }, { + "apiVersion": "apps/v1", "kind": "Deployment", - "apiVersion": "extensions/v1beta1", "metadata": { - "name": "hygieia-udeploy-collector", + "annotations": { + "kompose.cmd": "%CMD%", + "kompose.version": "%VERSION%" + }, "creationTimestamp": null, "labels": { "io.kompose.service": "hygieia-udeploy-collector" }, - "annotations": { - "kompose.cmd": "%CMD%", - "kompose.version": "%VERSION%" - } + "name": "hygieia-udeploy-collector" }, "spec": { "replicas": 1, + "selector": { + "matchLabels": { + "io.kompose.service": "hygieia-udeploy-collector" + } + }, + "strategy": { + "type": "Recreate" + }, "template": { "metadata": { - "creationTimestamp": null, - "labels": { - "io.kompose.service": "hygieia-udeploy-collector" - }, "annotations": { "kompose.cmd": "%CMD%", "kompose.version": "%VERSION%" + }, + "creationTimestamp": null, + "labels": { + "io.kompose.service": "hygieia-udeploy-collector" } }, "spec": { - "volumes": [ - { - "name": "hygieia-udeploy-collector-claim0", - "persistentVolumeClaim": { - "claimName": "hygieia-udeploy-collector-claim0" - } - } - ], "containers": [ { - "name": "hygieia-udeploy", - "image": "hygieia-udeploy-collector:latest", "env": [ { "name": "UDEPLOY_PASSWORD", @@ -882,20 +943,29 @@ "value": "-bobama" } ], + "image": "hygieia-udeploy-collector:latest", + "imagePullPolicy": "", + "name": "hygieia-udeploy", "resources": {}, "volumeMounts": [ { - "name": "hygieia-udeploy-collector-claim0", - "mountPath": "/hygieia/logs" + "mountPath": "/hygieia/logs", + "name": "hygieia-udeploy-collector-claim0" } ] } ], - "restartPolicy": "Always" + "restartPolicy": "Always", + "serviceAccountName": "", + "volumes": [ + { + "name": "hygieia-udeploy-collector-claim0", + "persistentVolumeClaim": { + "claimName": "hygieia-udeploy-collector-claim0" + } + } + ] } - }, - "strategy": { - "type": "Recreate" } }, "status": {} @@ -923,37 +993,44 @@ "status": {} }, { + "apiVersion": "apps/v1", "kind": "Deployment", - "apiVersion": "extensions/v1beta1", "metadata": { - "name": "hygieia-ui", + "annotations": { + "kompose.cmd": "%CMD%", + "kompose.version": "%VERSION%" + }, "creationTimestamp": null, "labels": { "io.kompose.service": "hygieia-ui" }, - "annotations": { - "kompose.cmd": "%CMD%", - "kompose.version": "%VERSION%" - } + "name": "hygieia-ui" }, "spec": { "replicas": 1, + "selector": { + "matchLabels": { + "io.kompose.service": "hygieia-ui" + } + }, + "strategy": {}, "template": { "metadata": { - "creationTimestamp": null, - "labels": { - "io.kompose.service": "hygieia-ui" - }, "annotations": { "kompose.cmd": "%CMD%", "kompose.version": "%VERSION%" + }, + "creationTimestamp": null, + "labels": { + "io.kompose.service": "hygieia-ui" } }, "spec": { "containers": [ { - "name": "hygieia-ui", "image": "hygieia-ui:latest", + "imagePullPolicy": "", + "name": "hygieia-ui", "ports": [ { "containerPort": 80 @@ -962,41 +1039,66 @@ "resources": {} } ], - "restartPolicy": "Always" + "restartPolicy": "Always", + "serviceAccountName": "", + "volumes": null } - }, - "strategy": {} + } }, "status": {} }, { + "apiVersion": "apps/v1", "kind": "Deployment", - "apiVersion": "extensions/v1beta1", "metadata": { - "name": "hygieia-versionone-collector", + "annotations": { + "kompose.cmd": "%CMD%", + "kompose.version": "%VERSION%" + }, "creationTimestamp": null, "labels": { "io.kompose.service": "hygieia-versionone-collector" }, - "annotations": { - "kompose.cmd": "%CMD%", - "kompose.version": "%VERSION%" - } + "name": "hygieia-versionone-collector" }, "spec": { "replicas": 1, + "selector": { + "matchLabels": { + "io.kompose.service": "hygieia-versionone-collector" + } + }, + "strategy": { + "type": "Recreate" + }, "template": { "metadata": { - "creationTimestamp": null, - "labels": { - "io.kompose.service": "hygieia-versionone-collector" - }, "annotations": { "kompose.cmd": "%CMD%", "kompose.version": "%VERSION%" + }, + "creationTimestamp": null, + "labels": { + "io.kompose.service": "hygieia-versionone-collector" } }, "spec": { + "containers": [ + { + "image": "hygieia-versionone-collector:latest", + "imagePullPolicy": "", + "name": "hygieia-versionone", + "resources": {}, + "volumeMounts": [ + { + "mountPath": "/hygieia/logs", + "name": "hygieia-versionone-collector-claim0" + } + ] + } + ], + "restartPolicy": "Always", + "serviceAccountName": "", "volumes": [ { "name": "hygieia-versionone-collector-claim0", @@ -1004,25 +1106,8 @@ "claimName": "hygieia-versionone-collector-claim0" } } - ], - "containers": [ - { - "name": "hygieia-versionone", - "image": "hygieia-versionone-collector:latest", - "resources": {}, - "volumeMounts": [ - { - "name": "hygieia-versionone-collector-claim0", - "mountPath": "/hygieia/logs" - } - ] - } - ], - "restartPolicy": "Always" + ] } - }, - "strategy": { - "type": "Recreate" } }, "status": {} @@ -1050,49 +1135,50 @@ "status": {} }, { + "apiVersion": "apps/v1", "kind": "Deployment", - "apiVersion": "extensions/v1beta1", "metadata": { - "name": "mongodb", + "annotations": { + "kompose.cmd": "%CMD%", + "kompose.version": "%VERSION%" + }, "creationTimestamp": null, "labels": { "io.kompose.service": "mongodb" }, - "annotations": { - "kompose.cmd": "%CMD%", - "kompose.version": "%VERSION%" - } + "name": "mongodb" }, "spec": { "replicas": 1, + "selector": { + "matchLabels": { + "io.kompose.service": "mongodb" + } + }, + "strategy": { + "type": "Recreate" + }, "template": { "metadata": { - "creationTimestamp": null, - "labels": { - "io.kompose.service": "mongodb" - }, "annotations": { "kompose.cmd": "%CMD%", "kompose.version": "%VERSION%" + }, + "creationTimestamp": null, + "labels": { + "io.kompose.service": "mongodb" } }, "spec": { - "volumes": [ - { - "name": "mongodb-claim0", - "persistentVolumeClaim": { - "claimName": "mongodb-claim0" - } - } - ], "containers": [ { - "name": "mongodb", - "image": "mongo:latest", "args": [ "mongod", "--smallfiles" ], + "image": "mongo:latest", + "imagePullPolicy": "", + "name": "mongodb", "ports": [ { "containerPort": 27017 @@ -1101,17 +1187,23 @@ "resources": {}, "volumeMounts": [ { - "name": "mongodb-claim0", - "mountPath": "/data/db" + "mountPath": "/data/db", + "name": "mongodb-claim0" } ] } ], - "restartPolicy": "Always" + "restartPolicy": "Always", + "serviceAccountName": "", + "volumes": [ + { + "name": "mongodb-claim0", + "persistentVolumeClaim": { + "claimName": "mongodb-claim0" + } + } + ] } - }, - "strategy": { - "type": "Recreate" } }, "status": {} diff --git a/script/test/fixtures/etherpad/output-k8s-template.json b/script/test/fixtures/etherpad/output-k8s-template.json index 34b94d5b..ea18a3e0 100644 --- a/script/test/fixtures/etherpad/output-k8s-template.json +++ b/script/test/fixtures/etherpad/output-k8s-template.json @@ -64,42 +64,41 @@ } }, { + "apiVersion": "apps/v1", "kind": "Deployment", - "apiVersion": "extensions/v1beta1", "metadata": { - "name": "etherpad", + "annotations": { + "kompose.cmd": "%CMD%", + "kompose.version": "%VERSION%" + }, "creationTimestamp": null, "labels": { "io.kompose.service": "etherpad" }, - "annotations": { - "kompose.cmd": "%CMD%", - "kompose.version": "%VERSION%" - } + "name": "etherpad" }, "spec": { "replicas": 1, + "selector": { + "matchLabels": { + "io.kompose.service": "etherpad" + } + }, + "strategy": {}, "template": { "metadata": { - "creationTimestamp": null, - "labels": { - "io.kompose.service": "etherpad" - }, "annotations": { "kompose.cmd": "%CMD%", "kompose.version": "%VERSION%" + }, + "creationTimestamp": null, + "labels": { + "io.kompose.service": "etherpad" } }, "spec": { "containers": [ { - "name": "etherpad", - "image": "centos/etherpad", - "ports": [ - { - "containerPort": 9001 - } - ], "env": [ { "name": "DB_DBID", @@ -122,61 +121,63 @@ "value": "etherpad" } ], + "image": "centos/etherpad", + "imagePullPolicy": "", + "name": "etherpad", + "ports": [ + { + "containerPort": 9001 + } + ], "resources": {} } ], - "restartPolicy": "Always" + "restartPolicy": "Always", + "serviceAccountName": "", + "volumes": null } - }, - "strategy": {} + } }, "status": {} }, { + "apiVersion": "apps/v1", "kind": "Deployment", - "apiVersion": "extensions/v1beta1", "metadata": { - "name": "mariadb", + "annotations": { + "kompose.cmd": "%CMD%", + "kompose.version": "%VERSION%" + }, "creationTimestamp": null, "labels": { "io.kompose.service": "mariadb" }, - "annotations": { - "kompose.cmd": "%CMD%", - "kompose.version": "%VERSION%" - } + "name": "mariadb" }, "spec": { "replicas": 1, + "selector": { + "matchLabels": { + "io.kompose.service": "mariadb" + } + }, + "strategy": { + "type": "Recreate" + }, "template": { "metadata": { - "creationTimestamp": null, - "labels": { - "io.kompose.service": "mariadb" - }, "annotations": { "kompose.cmd": "%CMD%", "kompose.version": "%VERSION%" + }, + "creationTimestamp": null, + "labels": { + "io.kompose.service": "mariadb" } }, "spec": { - "volumes": [ - { - "name": "mariadb-claim0", - "persistentVolumeClaim": { - "claimName": "mariadb-claim0" - } - } - ], "containers": [ { - "name": "mariadb", - "image": "centos/mariadb", - "ports": [ - { - "containerPort": 3306 - } - ], "env": [ { "name": "MYSQL_DATABASE", @@ -195,20 +196,34 @@ "value": "etherpad" } ], + "image": "centos/mariadb", + "imagePullPolicy": "", + "name": "mariadb", + "ports": [ + { + "containerPort": 3306 + } + ], "resources": {}, "volumeMounts": [ { - "name": "mariadb-claim0", - "mountPath": "/var/lib/mysql" + "mountPath": "/var/lib/mysql", + "name": "mariadb-claim0" } ] } ], - "restartPolicy": "Always" + "restartPolicy": "Always", + "serviceAccountName": "", + "volumes": [ + { + "name": "mariadb-claim0", + "persistentVolumeClaim": { + "claimName": "mariadb-claim0" + } + } + ] } - }, - "strategy": { - "type": "Recreate" } }, "status": {} diff --git a/script/test/fixtures/examples/output-counter-k8s.json b/script/test/fixtures/examples/output-counter-k8s.json index 9c1dc11d..40e2b826 100644 --- a/script/test/fixtures/examples/output-counter-k8s.json +++ b/script/test/fixtures/examples/output-counter-k8s.json @@ -64,37 +64,44 @@ } }, { + "apiVersion": "apps/v1", "kind": "Deployment", - "apiVersion": "extensions/v1beta1", "metadata": { - "name": "redis", + "annotations": { + "kompose.cmd": "%CMD%", + "kompose.version": "%VERSION%" + }, "creationTimestamp": null, "labels": { "io.kompose.service": "redis" }, - "annotations": { - "kompose.cmd": "%CMD%", - "kompose.version": "%VERSION%" - } + "name": "redis" }, "spec": { "replicas": 1, + "selector": { + "matchLabels": { + "io.kompose.service": "redis" + } + }, + "strategy": {}, "template": { "metadata": { - "creationTimestamp": null, - "labels": { - "io.kompose.service": "redis" - }, "annotations": { "kompose.cmd": "%CMD%", "kompose.version": "%VERSION%" + }, + "creationTimestamp": null, + "labels": { + "io.kompose.service": "redis" } }, "spec": { "containers": [ { - "name": "redis", "image": "redis:3.0", + "imagePullPolicy": "", + "name": "redis", "ports": [ { "containerPort": 6379 @@ -103,45 +110,53 @@ "resources": {} } ], - "restartPolicy": "Always" + "restartPolicy": "Always", + "serviceAccountName": "", + "volumes": null } - }, - "strategy": {} + } }, "status": {} }, { + "apiVersion": "apps/v1", "kind": "Deployment", - "apiVersion": "extensions/v1beta1", "metadata": { - "name": "web", + "annotations": { + "kompose.cmd": "%CMD%", + "kompose.version": "%VERSION%" + }, "creationTimestamp": null, "labels": { "io.kompose.service": "web" }, - "annotations": { - "kompose.cmd": "%CMD%", - "kompose.version": "%VERSION%" - } + "name": "web" }, "spec": { "replicas": 1, + "selector": { + "matchLabels": { + "io.kompose.service": "web" + } + }, + "strategy": {}, "template": { "metadata": { - "creationTimestamp": null, - "labels": { - "io.kompose.service": "web" - }, "annotations": { "kompose.cmd": "%CMD%", "kompose.version": "%VERSION%" + }, + "creationTimestamp": null, + "labels": { + "io.kompose.service": "web" } }, "spec": { "containers": [ { - "name": "web", "image": "tuna/docker-counter23", + "imagePullPolicy": "", + "name": "web", "ports": [ { "containerPort": 5000 @@ -150,10 +165,11 @@ "resources": {} } ], - "restartPolicy": "Always" + "restartPolicy": "Always", + "serviceAccountName": "", + "volumes": null } - }, - "strategy": {} + } }, "status": {} } diff --git a/script/test/fixtures/examples/output-counter-v3-k8s.json b/script/test/fixtures/examples/output-counter-v3-k8s.json index aca59cc8..4a608f37 100644 --- a/script/test/fixtures/examples/output-counter-v3-k8s.json +++ b/script/test/fixtures/examples/output-counter-v3-k8s.json @@ -43,8 +43,8 @@ "io.kompose.service": "web" }, "annotations": { - "kompose.service.type": "NodePort", "kompose.cmd": "%CMD%", + "kompose.service.type": "NodePort", "kompose.version": "%VERSION%" } }, @@ -66,37 +66,44 @@ } }, { + "apiVersion": "apps/v1", "kind": "Deployment", - "apiVersion": "extensions/v1beta1", "metadata": { - "name": "redis", + "annotations": { + "kompose.cmd": "%CMD%", + "kompose.version": "%VERSION%" + }, "creationTimestamp": null, "labels": { "io.kompose.service": "redis" }, - "annotations": { - "kompose.cmd": "%CMD%", - "kompose.version": "%VERSION%" - } + "name": "redis" }, "spec": { "replicas": 1, + "selector": { + "matchLabels": { + "io.kompose.service": "redis" + } + }, + "strategy": {}, "template": { "metadata": { - "creationTimestamp": null, - "labels": { - "io.kompose.service": "redis" - }, "annotations": { "kompose.cmd": "%CMD%", "kompose.version": "%VERSION%" + }, + "creationTimestamp": null, + "labels": { + "io.kompose.service": "redis" } }, "spec": { "containers": [ { - "name": "redis", "image": "redis:3.0", + "imagePullPolicy": "", + "name": "redis", "ports": [ { "containerPort": 6379 @@ -105,47 +112,55 @@ "resources": {} } ], - "restartPolicy": "Always" + "restartPolicy": "Always", + "serviceAccountName": "", + "volumes": null } - }, - "strategy": {} + } }, "status": {} }, { + "apiVersion": "apps/v1", "kind": "Deployment", - "apiVersion": "extensions/v1beta1", "metadata": { - "name": "web", + "annotations": { + "kompose.cmd": "%CMD%", + "kompose.service.type": "NodePort", + "kompose.version": "%VERSION%" + }, "creationTimestamp": null, "labels": { "io.kompose.service": "web" }, - "annotations": { - "kompose.service.type": "NodePort", - "kompose.cmd": "%CMD%", - "kompose.version": "%VERSION%" - } + "name": "web" }, "spec": { "replicas": 1, + "selector": { + "matchLabels": { + "io.kompose.service": "web" + } + }, + "strategy": {}, "template": { "metadata": { + "annotations": { + "kompose.cmd": "%CMD%", + "kompose.service.type": "NodePort", + "kompose.version": "%VERSION%" + }, "creationTimestamp": null, "labels": { "io.kompose.service": "web" - }, - "annotations": { - "kompose.service.type": "NodePort", - "kompose.cmd": "%CMD%", - "kompose.version": "%VERSION%" } }, "spec": { "containers": [ { - "name": "web", "image": "tuna/docker-counter23", + "imagePullPolicy": "", + "name": "web", "ports": [ { "containerPort": 5000 @@ -154,10 +169,11 @@ "resources": {} } ], - "restartPolicy": "Always" + "restartPolicy": "Always", + "serviceAccountName": "", + "volumes": null } - }, - "strategy": {} + } }, "status": {} } diff --git a/script/test/fixtures/examples/output-gitlab-k8s.json b/script/test/fixtures/examples/output-gitlab-k8s.json index 5a685005..72a359f5 100644 --- a/script/test/fixtures/examples/output-gitlab-k8s.json +++ b/script/test/fixtures/examples/output-gitlab-k8s.json @@ -13,8 +13,8 @@ "io.kompose.service": "gitlab" }, "annotations": { - "kompose.service.type": "NodePort", "kompose.cmd": "%CMD%", + "kompose.service.type": "NodePort", "kompose.version": "%VERSION%" } }, @@ -101,56 +101,45 @@ } }, { + "apiVersion": "apps/v1", "kind": "Deployment", - "apiVersion": "extensions/v1beta1", "metadata": { - "name": "gitlab", + "annotations": { + "kompose.cmd": "%CMD%", + "kompose.service.type": "NodePort", + "kompose.version": "%VERSION%" + }, "creationTimestamp": null, "labels": { "io.kompose.service": "gitlab" }, - "annotations": { - "kompose.service.type": "NodePort", - "kompose.cmd": "%CMD%", - "kompose.version": "%VERSION%" - - } + "name": "gitlab" }, "spec": { "replicas": 1, + "selector": { + "matchLabels": { + "io.kompose.service": "gitlab" + } + }, + "strategy": { + "type": "Recreate" + }, "template": { "metadata": { + "annotations": { + "kompose.cmd": "%CMD%", + "kompose.service.type": "NodePort", + "kompose.version": "%VERSION%" + }, "creationTimestamp": null, "labels": { "io.kompose.service": "gitlab" - }, - "annotations": { - "kompose.service.type": "NodePort", - "kompose.cmd": "%CMD%", - "kompose.version": "%VERSION%" } }, "spec": { - "volumes": [ - { - "name": "gitlab-claim0", - "persistentVolumeClaim": { - "claimName": "gitlab-claim0" - } - } - ], "containers": [ { - "name": "gitlab", - "image": "sameersbn/gitlab:8.13.3", - "ports": [ - { - "containerPort": 80 - }, - { - "containerPort": 22 - } - ], "env": [ { "name": "DB_ADAPTER", @@ -484,20 +473,37 @@ "value": "Asia/Kolkata" } ], + "image": "sameersbn/gitlab:8.13.3", + "imagePullPolicy": "", + "name": "gitlab", + "ports": [ + { + "containerPort": 80 + }, + { + "containerPort": 22 + } + ], "resources": {}, "volumeMounts": [ { - "name": "gitlab-claim0", - "mountPath": "/home/git/data" + "mountPath": "/home/git/data", + "name": "gitlab-claim0" } ] } ], - "restartPolicy": "Always" + "restartPolicy": "Always", + "serviceAccountName": "", + "volumes": [ + { + "name": "gitlab-claim0", + "persistentVolumeClaim": { + "claimName": "gitlab-claim0" + } + } + ] } - }, - "strategy": { - "type": "Recreate" } }, "status": {} @@ -525,50 +531,43 @@ "status": {} }, { + "apiVersion": "apps/v1", "kind": "Deployment", - "apiVersion": "extensions/v1beta1", "metadata": { - "name": "postgresql", + "annotations": { + "kompose.cmd": "%CMD%", + "kompose.version": "%VERSION%" + }, "creationTimestamp": null, "labels": { "io.kompose.service": "postgresql" }, - "annotations": { - "kompose.cmd": "%CMD%", - "kompose.version": "%VERSION%" - } + "name": "postgresql" }, "spec": { "replicas": 1, + "selector": { + "matchLabels": { + "io.kompose.service": "postgresql" + } + }, + "strategy": { + "type": "Recreate" + }, "template": { "metadata": { - "creationTimestamp": null, - "labels": { - "io.kompose.service": "postgresql" - }, "annotations": { "kompose.cmd": "%CMD%", "kompose.version": "%VERSION%" + }, + "creationTimestamp": null, + "labels": { + "io.kompose.service": "postgresql" } }, "spec": { - "volumes": [ - { - "name": "postgresql-claim0", - "persistentVolumeClaim": { - "claimName": "postgresql-claim0" - } - } - ], "containers": [ { - "name": "postgresql", - "image": "sameersbn/postgresql:9.5-3", - "ports": [ - { - "containerPort": 5432 - } - ], "env": [ { "name": "DB_EXTENSION", @@ -587,20 +586,34 @@ "value": "gitlab" } ], + "image": "sameersbn/postgresql:9.5-3", + "imagePullPolicy": "", + "name": "postgresql", + "ports": [ + { + "containerPort": 5432 + } + ], "resources": {}, "volumeMounts": [ { - "name": "postgresql-claim0", - "mountPath": "/var/lib/postgresql" + "mountPath": "/var/lib/postgresql", + "name": "postgresql-claim0" } ] } ], - "restartPolicy": "Always" + "restartPolicy": "Always", + "serviceAccountName": "", + "volumes": [ + { + "name": "postgresql-claim0", + "persistentVolumeClaim": { + "claimName": "postgresql-claim0" + } + } + ] } - }, - "strategy": { - "type": "Recreate" } }, "status": {} @@ -628,48 +641,49 @@ "status": {} }, { + "apiVersion": "apps/v1", "kind": "Deployment", - "apiVersion": "extensions/v1beta1", "metadata": { - "name": "redis", + "annotations": { + "kompose.cmd": "%CMD%", + "kompose.version": "%VERSION%" + }, "creationTimestamp": null, "labels": { "io.kompose.service": "redis" }, - "annotations": { - "kompose.cmd": "%CMD%", - "kompose.version": "%VERSION%" - } + "name": "redis" }, "spec": { "replicas": 1, + "selector": { + "matchLabels": { + "io.kompose.service": "redis" + } + }, + "strategy": { + "type": "Recreate" + }, "template": { "metadata": { - "creationTimestamp": null, - "labels": { - "io.kompose.service": "redis" - }, "annotations": { "kompose.cmd": "%CMD%", "kompose.version": "%VERSION%" + }, + "creationTimestamp": null, + "labels": { + "io.kompose.service": "redis" } }, "spec": { - "volumes": [ - { - "name": "redis-claim0", - "persistentVolumeClaim": { - "claimName": "redis-claim0" - } - } - ], "containers": [ { - "name": "redis", - "image": "sameersbn/redis:latest", "args": [ "--loglevel warning" ], + "image": "sameersbn/redis:latest", + "imagePullPolicy": "", + "name": "redis", "ports": [ { "containerPort": 6379 @@ -678,17 +692,23 @@ "resources": {}, "volumeMounts": [ { - "name": "redis-claim0", - "mountPath": "/var/lib/redis" + "mountPath": "/var/lib/redis", + "name": "redis-claim0" } ] } ], - "restartPolicy": "Always" + "restartPolicy": "Always", + "serviceAccountName": "", + "volumes": [ + { + "name": "redis-claim0", + "persistentVolumeClaim": { + "claimName": "redis-claim0" + } + } + ] } - }, - "strategy": { - "type": "Recreate" } }, "status": {} diff --git a/script/test/fixtures/examples/output-k8s.json b/script/test/fixtures/examples/output-k8s.json index 688742fa..58f6fc8f 100644 --- a/script/test/fixtures/examples/output-k8s.json +++ b/script/test/fixtures/examples/output-k8s.json @@ -97,7 +97,7 @@ }, { "kind": "Deployment", - "apiVersion": "extensions/v1beta1", + "apiVersion": "apps/v1", "metadata": { "name": "frontend", "creationTimestamp": null, @@ -152,7 +152,7 @@ }, { "kind": "Deployment", - "apiVersion": "extensions/v1beta1", + "apiVersion": "apps/v1", "metadata": { "name": "redis-master", "creationTimestamp": null, @@ -199,7 +199,7 @@ }, { "kind": "Deployment", - "apiVersion": "extensions/v1beta1", + "apiVersion": "apps/v1", "metadata": { "name": "redis-slave", "creationTimestamp": null, diff --git a/script/test/fixtures/examples/output-v3-k8s.json b/script/test/fixtures/examples/output-v3-k8s.json index 688742fa..4502c4e0 100644 --- a/script/test/fixtures/examples/output-v3-k8s.json +++ b/script/test/fixtures/examples/output-v3-k8s.json @@ -13,8 +13,8 @@ "io.kompose.service": "frontend" }, "annotations": { - "kompose.service.type": "LoadBalancer", "kompose.cmd": "%CMD%", + "kompose.service.type": "LoadBalancer", "kompose.version": "%VERSION%" } }, @@ -96,92 +96,107 @@ } }, { + "apiVersion": "apps/v1", "kind": "Deployment", - "apiVersion": "extensions/v1beta1", "metadata": { - "name": "frontend", + "annotations": { + "kompose.cmd": "%CMD%", + "kompose.service.type": "LoadBalancer", + "kompose.version": "%VERSION%" + }, "creationTimestamp": null, "labels": { "io.kompose.service": "frontend" }, - "annotations": { - "kompose.service.type": "LoadBalancer", - "kompose.cmd": "%CMD%", - "kompose.version": "%VERSION%" - } + "name": "frontend" }, "spec": { "replicas": 1, + "selector": { + "matchLabels": { + "io.kompose.service": "frontend" + } + }, + "strategy": {}, "template": { "metadata": { + "annotations": { + "kompose.cmd": "%CMD%", + "kompose.service.type": "LoadBalancer", + "kompose.version": "%VERSION%" + }, "creationTimestamp": null, "labels": { "io.kompose.service": "frontend" - }, - "annotations": { - "kompose.service.type": "LoadBalancer", - "kompose.cmd": "%CMD%", - "kompose.version": "%VERSION%" } }, "spec": { "containers": [ { - "name": "frontend", + "env": [ + { + "name": "GET_HOSTS_FROM", + "value": "dns" + } + ], "image": "gcr.io/google-samples/gb-frontend:v4", + "imagePullPolicy": "", + "name": "frontend", "ports": [ { "containerPort": 80 } ], - "env": [ - { - "name": "GET_HOSTS_FROM", - "value": "dns" - } - ], "resources": {} } ], - "restartPolicy": "Always" + "restartPolicy": "Always", + "serviceAccountName": "", + "volumes": null } - }, - "strategy": {} + } }, "status": {} }, { + "apiVersion": "apps/v1", "kind": "Deployment", - "apiVersion": "extensions/v1beta1", "metadata": { - "name": "redis-master", + "annotations": { + "kompose.cmd": "%CMD%", + "kompose.version": "%VERSION%" + }, "creationTimestamp": null, "labels": { "io.kompose.service": "redis-master" }, - "annotations": { - "kompose.cmd": "%CMD%", - "kompose.version": "%VERSION%" - } + "name": "redis-master" }, "spec": { "replicas": 1, + "selector": { + "matchLabels": { + "io.kompose.service": "redis-master" + } + }, + "strategy": {}, "template": { "metadata": { - "creationTimestamp": null, - "labels": { - "io.kompose.service": "redis-master" - }, "annotations": { "kompose.cmd": "%CMD%", "kompose.version": "%VERSION%" + }, + "creationTimestamp": null, + "labels": { + "io.kompose.service": "redis-master" } }, "spec": { "containers": [ { - "name": "redis-master", "image": "k8s.gcr.io/redis:e2e", + "imagePullPolicy": "", + "name": "redis-master", "ports": [ { "containerPort": 6379 @@ -190,63 +205,72 @@ "resources": {} } ], - "restartPolicy": "Always" + "restartPolicy": "Always", + "serviceAccountName": "", + "volumes": null } - }, - "strategy": {} + } }, "status": {} }, { + "apiVersion": "apps/v1", "kind": "Deployment", - "apiVersion": "extensions/v1beta1", "metadata": { - "name": "redis-slave", + "annotations": { + "kompose.cmd": "%CMD%", + "kompose.version": "%VERSION%" + }, "creationTimestamp": null, "labels": { "io.kompose.service": "redis-slave" }, - "annotations": { - "kompose.cmd": "%CMD%", - "kompose.version": "%VERSION%" - } + "name": "redis-slave" }, "spec": { "replicas": 1, + "selector": { + "matchLabels": { + "io.kompose.service": "redis-slave" + } + }, + "strategy": {}, "template": { "metadata": { - "creationTimestamp": null, - "labels": { - "io.kompose.service": "redis-slave" - }, "annotations": { "kompose.cmd": "%CMD%", "kompose.version": "%VERSION%" + }, + "creationTimestamp": null, + "labels": { + "io.kompose.service": "redis-slave" } }, "spec": { "containers": [ { - "name": "redis-slave", - "image": "gcr.io/google_samples/gb-redisslave:v1", - "ports": [ - { - "containerPort": 6379 - } - ], "env": [ { "name": "GET_HOSTS_FROM", "value": "dns" } ], + "image": "gcr.io/google_samples/gb-redisslave:v1", + "imagePullPolicy": "", + "name": "redis-slave", + "ports": [ + { + "containerPort": 6379 + } + ], "resources": {} } ], - "restartPolicy": "Always" + "restartPolicy": "Always", + "serviceAccountName": "", + "volumes": null } - }, - "strategy": {} + } }, "status": {} } diff --git a/script/test/fixtures/examples/output-voting-k8s.json b/script/test/fixtures/examples/output-voting-k8s.json index acd54b1d..47909ae9 100644 --- a/script/test/fixtures/examples/output-voting-k8s.json +++ b/script/test/fixtures/examples/output-voting-k8s.json @@ -126,39 +126,46 @@ } }, { + "apiVersion": "apps/v1", "kind": "Deployment", - "apiVersion": "extensions/v1beta1", "metadata": { - "name": "db", - "creationTimestamp": null, - "labels": { - "io.kompose.service": "db" - }, "annotations": { "com.example.description": "Postgres Database", "kompose.cmd": "%CMD%", "kompose.version": "%VERSION%" - } + }, + "creationTimestamp": null, + "labels": { + "io.kompose.service": "db" + }, + "name": "db" }, "spec": { "replicas": 1, + "selector": { + "matchLabels": { + "io.kompose.service": "db" + } + }, + "strategy": {}, "template": { "metadata": { - "creationTimestamp": null, - "labels": { - "io.kompose.service": "db" - }, "annotations": { "com.example.description": "Postgres Database", "kompose.cmd": "%CMD%", "kompose.version": "%VERSION%" + }, + "creationTimestamp": null, + "labels": { + "io.kompose.service": "db" } }, "spec": { "containers": [ { - "name": "db", "image": "postgres:9.4", + "imagePullPolicy": "", + "name": "db", "ports": [ { "containerPort": 5432 @@ -167,45 +174,53 @@ "resources": {} } ], - "restartPolicy": "Always" + "restartPolicy": "Always", + "serviceAccountName": "", + "volumes": null } - }, - "strategy": {} + } }, "status": {} }, { + "apiVersion": "apps/v1", "kind": "Deployment", - "apiVersion": "extensions/v1beta1", "metadata": { - "name": "redis", + "annotations": { + "kompose.cmd": "%CMD%", + "kompose.version": "%VERSION%" + }, "creationTimestamp": null, "labels": { "io.kompose.service": "redis" }, - "annotations": { - "kompose.cmd": "%CMD%", - "kompose.version": "%VERSION%" - } + "name": "redis" }, "spec": { "replicas": 1, + "selector": { + "matchLabels": { + "io.kompose.service": "redis" + } + }, + "strategy": {}, "template": { "metadata": { - "creationTimestamp": null, - "labels": { - "io.kompose.service": "redis" - }, "annotations": { "kompose.cmd": "%CMD%", "kompose.version": "%VERSION%" + }, + "creationTimestamp": null, + "labels": { + "io.kompose.service": "redis" } }, "spec": { "containers": [ { - "name": "redis", "image": "redis:alpine", + "imagePullPolicy": "", + "name": "redis", "ports": [ { "containerPort": 6379 @@ -214,45 +229,53 @@ "resources": {} } ], - "restartPolicy": "Always" + "restartPolicy": "Always", + "serviceAccountName": "", + "volumes": null } - }, - "strategy": {} + } }, "status": {} }, { + "apiVersion": "apps/v1", "kind": "Deployment", - "apiVersion": "extensions/v1beta1", "metadata": { - "name": "result", + "annotations": { + "kompose.cmd": "%CMD%", + "kompose.version": "%VERSION%" + }, "creationTimestamp": null, "labels": { "io.kompose.service": "result" }, - "annotations": { - "kompose.cmd": "%CMD%", - "kompose.version": "%VERSION%" - } + "name": "result" }, "spec": { "replicas": 1, + "selector": { + "matchLabels": { + "io.kompose.service": "result" + } + }, + "strategy": {}, "template": { "metadata": { - "creationTimestamp": null, - "labels": { - "io.kompose.service": "result" - }, "annotations": { "kompose.cmd": "%CMD%", "kompose.version": "%VERSION%" + }, + "creationTimestamp": null, + "labels": { + "io.kompose.service": "result" } }, "spec": { "containers": [ { - "name": "result", "image": "tmadams333/example-voting-app-result:latest", + "imagePullPolicy": "", + "name": "result", "ports": [ { "containerPort": 80 @@ -261,47 +284,55 @@ "resources": {} } ], - "restartPolicy": "Always" + "restartPolicy": "Always", + "serviceAccountName": "", + "volumes": null } - }, - "strategy": {} + } }, "status": {} }, { + "apiVersion": "apps/v1", "kind": "Deployment", - "apiVersion": "extensions/v1beta1", "metadata": { - "name": "vote", - "creationTimestamp": null, - "labels": { - "io.kompose.service": "vote" - }, "annotations": { "com.example.description": "Vote", "kompose.cmd": "%CMD%", "kompose.version": "%VERSION%" - } + }, + "creationTimestamp": null, + "labels": { + "io.kompose.service": "vote" + }, + "name": "vote" }, "spec": { "replicas": 1, + "selector": { + "matchLabels": { + "io.kompose.service": "vote" + } + }, + "strategy": {}, "template": { "metadata": { - "creationTimestamp": null, - "labels": { - "io.kompose.service": "vote" - }, "annotations": { "com.example.description": "Vote", "kompose.cmd": "%CMD%", "kompose.version": "%VERSION%" + }, + "creationTimestamp": null, + "labels": { + "io.kompose.service": "vote" } }, "spec": { "containers": [ { - "name": "vote", "image": "docker/example-voting-app-vote:latest", + "imagePullPolicy": "", + "name": "vote", "ports": [ { "containerPort": 80 @@ -310,52 +341,61 @@ "resources": {} } ], - "restartPolicy": "Always" + "restartPolicy": "Always", + "serviceAccountName": "", + "volumes": null } - }, - "strategy": {} + } }, "status": {} }, { + "apiVersion": "apps/v1", "kind": "Deployment", - "apiVersion": "extensions/v1beta1", "metadata": { - "name": "worker", + "annotations": { + "kompose.cmd": "%CMD%", + "kompose.version": "%VERSION%" + }, "creationTimestamp": null, "labels": { "io.kompose.service": "worker" }, - "annotations": { - "kompose.cmd": "%CMD%", - "kompose.version": "%VERSION%" - } + "name": "worker" }, "spec": { "replicas": 1, + "selector": { + "matchLabels": { + "io.kompose.service": "worker" + } + }, + "strategy": {}, "template": { "metadata": { - "creationTimestamp": null, - "labels": { - "io.kompose.service": "worker" - }, "annotations": { "kompose.cmd": "%CMD%", "kompose.version": "%VERSION%" + }, + "creationTimestamp": null, + "labels": { + "io.kompose.service": "worker" } }, "spec": { "containers": [ { - "name": "worker", "image": "docker/example-voting-app-worker:latest", + "imagePullPolicy": "", + "name": "worker", "resources": {} } ], - "restartPolicy": "Always" + "restartPolicy": "Always", + "serviceAccountName": "", + "volumes": null } - }, - "strategy": {} + } }, "status": {} } 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 66330aff..f9202b0b 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 @@ -44,8 +44,8 @@ }, "annotations": { "kompose.cmd": "%CMD%", - "kompose.version": "%VERSION%", - "kompose.service.expose": "batman.example.com" + "kompose.service.expose": "batman.example.com", + "kompose.version": "%VERSION%" } }, "spec": { @@ -70,37 +70,44 @@ } }, { + "apiVersion": "apps/v1", "kind": "Deployment", - "apiVersion": "extensions/v1beta1", "metadata": { - "name": "redis", + "annotations": { + "kompose.cmd": "%CMD%", + "kompose.version": "%VERSION%" + }, "creationTimestamp": null, "labels": { "io.kompose.service": "redis" }, - "annotations": { - "kompose.cmd": "%CMD%", - "kompose.version": "%VERSION%" - } + "name": "redis" }, "spec": { "replicas": 1, + "selector": { + "matchLabels": { + "io.kompose.service": "redis" + } + }, + "strategy": {}, "template": { "metadata": { - "creationTimestamp": null, - "labels": { - "io.kompose.service": "redis" - }, "annotations": { "kompose.cmd": "%CMD%", "kompose.version": "%VERSION%" + }, + "creationTimestamp": null, + "labels": { + "io.kompose.service": "redis" } }, "spec": { "containers": [ { - "name": "redis", "image": "redis:3.0", + "imagePullPolicy": "", + "name": "redis", "ports": [ { "containerPort": 6379 @@ -109,47 +116,55 @@ "resources": {} } ], - "restartPolicy": "Always" + "restartPolicy": "Always", + "serviceAccountName": "", + "volumes": null } - }, - "strategy": {} + } }, "status": {} }, { + "apiVersion": "apps/v1", "kind": "Deployment", - "apiVersion": "extensions/v1beta1", "metadata": { - "name": "web", + "annotations": { + "kompose.cmd": "%CMD%", + "kompose.service.expose": "batman.example.com", + "kompose.version": "%VERSION%" + }, "creationTimestamp": null, "labels": { "io.kompose.service": "web" }, - "annotations": { - "kompose.cmd": "%CMD%", - "kompose.version": "%VERSION%", - "kompose.service.expose": "batman.example.com" - } + "name": "web" }, "spec": { "replicas": 1, + "selector": { + "matchLabels": { + "io.kompose.service": "web" + } + }, + "strategy": {}, "template": { "metadata": { + "annotations": { + "kompose.cmd": "%CMD%", + "kompose.service.expose": "batman.example.com", + "kompose.version": "%VERSION%" + }, "creationTimestamp": null, "labels": { "io.kompose.service": "web" - }, - "annotations": { - "kompose.cmd": "%CMD%", - "kompose.version": "%VERSION%", - "kompose.service.expose": "batman.example.com" } }, "spec": { "containers": [ { - "name": "web", "image": "tuna/docker-counter23", + "imagePullPolicy": "", + "name": "web", "ports": [ { "containerPort": 5000 @@ -161,10 +176,11 @@ "resources": {} } ], - "restartPolicy": "Always" + "restartPolicy": "Always", + "serviceAccountName": "", + "volumes": null } - }, - "strategy": {} + } }, "status": {} }, diff --git a/script/test/fixtures/expose-service/provider-files/kubernetes-expose-hostname-tls.json b/script/test/fixtures/expose-service/provider-files/kubernetes-expose-hostname-tls.json index 6fe7cb70..6055082d 100644 --- a/script/test/fixtures/expose-service/provider-files/kubernetes-expose-hostname-tls.json +++ b/script/test/fixtures/expose-service/provider-files/kubernetes-expose-hostname-tls.json @@ -44,9 +44,9 @@ }, "annotations": { "kompose.cmd": "%CMD%", - "kompose.version": "%VERSION%", "kompose.service.expose": "batman.example.com", - "kompose.service.expose.tls-secret": "test-secret" + "kompose.service.expose.tls-secret": "test-secret", + "kompose.version": "%VERSION%" } }, "spec": { @@ -66,37 +66,44 @@ } }, { + "apiVersion": "apps/v1", "kind": "Deployment", - "apiVersion": "extensions/v1beta1", "metadata": { - "name": "redis", + "annotations": { + "kompose.cmd": "%CMD%", + "kompose.version": "%VERSION%" + }, "creationTimestamp": null, "labels": { "io.kompose.service": "redis" }, - "annotations": { - "kompose.cmd": "%CMD%", - "kompose.version": "%VERSION%" - } + "name": "redis" }, "spec": { "replicas": 1, + "selector": { + "matchLabels": { + "io.kompose.service": "redis" + } + }, + "strategy": {}, "template": { "metadata": { - "creationTimestamp": null, - "labels": { - "io.kompose.service": "redis" - }, "annotations": { "kompose.cmd": "%CMD%", "kompose.version": "%VERSION%" + }, + "creationTimestamp": null, + "labels": { + "io.kompose.service": "redis" } }, "spec": { "containers": [ { - "name": "redis", "image": "redis:3.0", + "imagePullPolicy": "", + "name": "redis", "ports": [ { "containerPort": 6379 @@ -105,49 +112,57 @@ "resources": {} } ], - "restartPolicy": "Always" + "restartPolicy": "Always", + "serviceAccountName": "", + "volumes": null } - }, - "strategy": {} + } }, "status": {} }, { + "apiVersion": "apps/v1", "kind": "Deployment", - "apiVersion": "extensions/v1beta1", "metadata": { - "name": "web", + "annotations": { + "kompose.cmd": "%CMD%", + "kompose.service.expose": "batman.example.com", + "kompose.service.expose.tls-secret": "test-secret", + "kompose.version": "%VERSION%" + }, "creationTimestamp": null, "labels": { "io.kompose.service": "web" }, - "annotations": { - "kompose.cmd": "%CMD%", - "kompose.version": "%VERSION%", - "kompose.service.expose": "batman.example.com", - "kompose.service.expose.tls-secret": "test-secret" - } + "name": "web" }, "spec": { "replicas": 1, + "selector": { + "matchLabels": { + "io.kompose.service": "web" + } + }, + "strategy": {}, "template": { "metadata": { + "annotations": { + "kompose.cmd": "%CMD%", + "kompose.service.expose": "batman.example.com", + "kompose.service.expose.tls-secret": "test-secret", + "kompose.version": "%VERSION%" + }, "creationTimestamp": null, "labels": { "io.kompose.service": "web" - }, - "annotations": { - "kompose.cmd": "%CMD%", - "kompose.version": "%VERSION%", - "kompose.service.expose": "batman.example.com", - "kompose.service.expose.tls-secret": "test-secret" } }, "spec": { "containers": [ { - "name": "web", "image": "tuna/docker-counter23", + "imagePullPolicy": "", + "name": "web", "ports": [ { "containerPort": 5000 @@ -156,10 +171,11 @@ "resources": {} } ], - "restartPolicy": "Always" + "restartPolicy": "Always", + "serviceAccountName": "", + "volumes": null } - }, - "strategy": {} + } }, "status": {} }, 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 5b115d66..41d69e3f 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 @@ -44,8 +44,8 @@ }, "annotations": { "kompose.cmd": "%CMD%", - "kompose.version": "%VERSION%", - "kompose.service.expose": "batman.example.com" + "kompose.service.expose": "batman.example.com", + "kompose.version": "%VERSION%" } }, "spec": { @@ -65,37 +65,44 @@ } }, { + "apiVersion": "apps/v1", "kind": "Deployment", - "apiVersion": "extensions/v1beta1", "metadata": { - "name": "redis", + "annotations": { + "kompose.cmd": "%CMD%", + "kompose.version": "%VERSION%" + }, "creationTimestamp": null, "labels": { "io.kompose.service": "redis" }, - "annotations": { - "kompose.cmd": "%CMD%", - "kompose.version": "%VERSION%" - } + "name": "redis" }, "spec": { "replicas": 1, + "selector": { + "matchLabels": { + "io.kompose.service": "redis" + } + }, + "strategy": {}, "template": { "metadata": { - "creationTimestamp": null, - "labels": { - "io.kompose.service": "redis" - }, "annotations": { "kompose.cmd": "%CMD%", "kompose.version": "%VERSION%" + }, + "creationTimestamp": null, + "labels": { + "io.kompose.service": "redis" } }, "spec": { "containers": [ { - "name": "redis", "image": "redis:3.0", + "imagePullPolicy": "", + "name": "redis", "ports": [ { "containerPort": 6379 @@ -104,47 +111,55 @@ "resources": {} } ], - "restartPolicy": "Always" + "restartPolicy": "Always", + "serviceAccountName": "", + "volumes": null } - }, - "strategy": {} + } }, "status": {} }, { + "apiVersion": "apps/v1", "kind": "Deployment", - "apiVersion": "extensions/v1beta1", "metadata": { - "name": "web", + "annotations": { + "kompose.cmd": "%CMD%", + "kompose.service.expose": "batman.example.com", + "kompose.version": "%VERSION%" + }, "creationTimestamp": null, "labels": { "io.kompose.service": "web" }, - "annotations": { - "kompose.cmd": "%CMD%", - "kompose.version": "%VERSION%", - "kompose.service.expose": "batman.example.com" - } + "name": "web" }, "spec": { "replicas": 1, + "selector": { + "matchLabels": { + "io.kompose.service": "web" + } + }, + "strategy": {}, "template": { "metadata": { + "annotations": { + "kompose.cmd": "%CMD%", + "kompose.service.expose": "batman.example.com", + "kompose.version": "%VERSION%" + }, "creationTimestamp": null, "labels": { "io.kompose.service": "web" - }, - "annotations": { - "kompose.cmd": "%CMD%", - "kompose.version": "%VERSION%", - "kompose.service.expose": "batman.example.com" } }, "spec": { "containers": [ { - "name": "web", "image": "tuna/docker-counter23", + "imagePullPolicy": "", + "name": "web", "ports": [ { "containerPort": 5000 @@ -153,10 +168,11 @@ "resources": {} } ], - "restartPolicy": "Always" + "restartPolicy": "Always", + "serviceAccountName": "", + "volumes": null } - }, - "strategy": {} + } }, "status": {} }, diff --git a/script/test/fixtures/expose-service/provider-files/kubernetes-expose-multiple-hostname-tls.json b/script/test/fixtures/expose-service/provider-files/kubernetes-expose-multiple-hostname-tls.json index b5e4cf39..5f2810e0 100644 --- a/script/test/fixtures/expose-service/provider-files/kubernetes-expose-multiple-hostname-tls.json +++ b/script/test/fixtures/expose-service/provider-files/kubernetes-expose-multiple-hostname-tls.json @@ -44,9 +44,9 @@ }, "annotations": { "kompose.cmd": "%CMD%", - "kompose.version": "%VERSION%", "kompose.service.expose": "batman.example.com,batwoman.example.com", - "kompose.service.expose.tls-secret": "test-secret" + "kompose.service.expose.tls-secret": "test-secret", + "kompose.version": "%VERSION%" } }, "spec": { @@ -66,37 +66,44 @@ } }, { + "apiVersion": "apps/v1", "kind": "Deployment", - "apiVersion": "extensions/v1beta1", "metadata": { - "name": "redis", + "annotations": { + "kompose.cmd": "%CMD%", + "kompose.version": "%VERSION%" + }, "creationTimestamp": null, "labels": { "io.kompose.service": "redis" }, - "annotations": { - "kompose.cmd": "%CMD%", - "kompose.version": "%VERSION%" - } + "name": "redis" }, "spec": { "replicas": 1, + "selector": { + "matchLabels": { + "io.kompose.service": "redis" + } + }, + "strategy": {}, "template": { "metadata": { - "creationTimestamp": null, - "labels": { - "io.kompose.service": "redis" - }, "annotations": { "kompose.cmd": "%CMD%", "kompose.version": "%VERSION%" + }, + "creationTimestamp": null, + "labels": { + "io.kompose.service": "redis" } }, "spec": { "containers": [ { - "name": "redis", "image": "redis:3.0", + "imagePullPolicy": "", + "name": "redis", "ports": [ { "containerPort": 6379 @@ -105,49 +112,57 @@ "resources": {} } ], - "restartPolicy": "Always" + "restartPolicy": "Always", + "serviceAccountName": "", + "volumes": null } - }, - "strategy": {} + } }, "status": {} }, { + "apiVersion": "apps/v1", "kind": "Deployment", - "apiVersion": "extensions/v1beta1", "metadata": { - "name": "web", + "annotations": { + "kompose.cmd": "%CMD%", + "kompose.service.expose": "batman.example.com,batwoman.example.com", + "kompose.service.expose.tls-secret": "test-secret", + "kompose.version": "%VERSION%" + }, "creationTimestamp": null, "labels": { "io.kompose.service": "web" }, - "annotations": { - "kompose.cmd": "%CMD%", - "kompose.version": "%VERSION%", - "kompose.service.expose": "batman.example.com,batwoman.example.com", - "kompose.service.expose.tls-secret": "test-secret" - } + "name": "web" }, "spec": { "replicas": 1, + "selector": { + "matchLabels": { + "io.kompose.service": "web" + } + }, + "strategy": {}, "template": { "metadata": { + "annotations": { + "kompose.cmd": "%CMD%", + "kompose.service.expose": "batman.example.com,batwoman.example.com", + "kompose.service.expose.tls-secret": "test-secret", + "kompose.version": "%VERSION%" + }, "creationTimestamp": null, "labels": { "io.kompose.service": "web" - }, - "annotations": { - "kompose.cmd": "%CMD%", - "kompose.version": "%VERSION%", - "kompose.service.expose": "batman.example.com,batwoman.example.com", - "kompose.service.expose.tls-secret": "test-secret" } }, "spec": { "containers": [ { - "name": "web", "image": "tuna/docker-counter23", + "imagePullPolicy": "", + "name": "web", "ports": [ { "containerPort": 5000 @@ -156,10 +171,11 @@ "resources": {} } ], - "restartPolicy": "Always" + "restartPolicy": "Always", + "serviceAccountName": "", + "volumes": null } - }, - "strategy": {} + } }, "status": {} }, diff --git a/script/test/fixtures/expose-service/provider-files/kubernetes-expose-multiple-hostname.json b/script/test/fixtures/expose-service/provider-files/kubernetes-expose-multiple-hostname.json index 10dc5cd0..245bc76a 100644 --- a/script/test/fixtures/expose-service/provider-files/kubernetes-expose-multiple-hostname.json +++ b/script/test/fixtures/expose-service/provider-files/kubernetes-expose-multiple-hostname.json @@ -44,8 +44,8 @@ }, "annotations": { "kompose.cmd": "%CMD%", - "kompose.version": "%VERSION%", - "kompose.service.expose": " batman.example.com ,, batwoman.example.com " + "kompose.service.expose": " batman.example.com ,, batwoman.example.com ", + "kompose.version": "%VERSION%" } }, "spec": { @@ -65,37 +65,44 @@ } }, { + "apiVersion": "apps/v1", "kind": "Deployment", - "apiVersion": "extensions/v1beta1", "metadata": { - "name": "redis", + "annotations": { + "kompose.cmd": "%CMD%", + "kompose.version": "%VERSION%" + }, "creationTimestamp": null, "labels": { "io.kompose.service": "redis" }, - "annotations": { - "kompose.cmd": "%CMD%", - "kompose.version": "%VERSION%" - } + "name": "redis" }, "spec": { "replicas": 1, + "selector": { + "matchLabels": { + "io.kompose.service": "redis" + } + }, + "strategy": {}, "template": { "metadata": { - "creationTimestamp": null, - "labels": { - "io.kompose.service": "redis" - }, "annotations": { "kompose.cmd": "%CMD%", "kompose.version": "%VERSION%" + }, + "creationTimestamp": null, + "labels": { + "io.kompose.service": "redis" } }, "spec": { "containers": [ { - "name": "redis", "image": "redis:3.0", + "imagePullPolicy": "", + "name": "redis", "ports": [ { "containerPort": 6379 @@ -104,47 +111,55 @@ "resources": {} } ], - "restartPolicy": "Always" + "restartPolicy": "Always", + "serviceAccountName": "", + "volumes": null } - }, - "strategy": {} + } }, "status": {} }, { + "apiVersion": "apps/v1", "kind": "Deployment", - "apiVersion": "extensions/v1beta1", "metadata": { - "name": "web", + "annotations": { + "kompose.cmd": "%CMD%", + "kompose.service.expose": " batman.example.com ,, batwoman.example.com ", + "kompose.version": "%VERSION%" + }, "creationTimestamp": null, "labels": { "io.kompose.service": "web" }, - "annotations": { - "kompose.cmd": "%CMD%", - "kompose.version": "%VERSION%", - "kompose.service.expose": " batman.example.com ,, batwoman.example.com " - } + "name": "web" }, "spec": { "replicas": 1, + "selector": { + "matchLabels": { + "io.kompose.service": "web" + } + }, + "strategy": {}, "template": { "metadata": { + "annotations": { + "kompose.cmd": "%CMD%", + "kompose.service.expose": " batman.example.com ,, batwoman.example.com ", + "kompose.version": "%VERSION%" + }, "creationTimestamp": null, "labels": { "io.kompose.service": "web" - }, - "annotations": { - "kompose.cmd": "%CMD%", - "kompose.version": "%VERSION%", - "kompose.service.expose": " batman.example.com ,, batwoman.example.com " } }, "spec": { "containers": [ { - "name": "web", "image": "tuna/docker-counter23", + "imagePullPolicy": "", + "name": "web", "ports": [ { "containerPort": 5000 @@ -153,10 +168,11 @@ "resources": {} } ], - "restartPolicy": "Always" + "restartPolicy": "Always", + "serviceAccountName": "", + "volumes": null } - }, - "strategy": {} + } }, "status": {} }, 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 13b1a912..2fcc0e91 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 @@ -44,8 +44,8 @@ }, "annotations": { "kompose.cmd": "%CMD%", - "kompose.version": "%VERSION%", - "kompose.service.expose": "True" + "kompose.service.expose": "True", + "kompose.version": "%VERSION%" } }, "spec": { @@ -70,37 +70,44 @@ } }, { + "apiVersion": "apps/v1", "kind": "Deployment", - "apiVersion": "extensions/v1beta1", "metadata": { - "name": "redis", + "annotations": { + "kompose.cmd": "%CMD%", + "kompose.version": "%VERSION%" + }, "creationTimestamp": null, "labels": { "io.kompose.service": "redis" }, - "annotations": { - "kompose.cmd": "%CMD%", - "kompose.version": "%VERSION%" - } + "name": "redis" }, "spec": { "replicas": 1, + "selector": { + "matchLabels": { + "io.kompose.service": "redis" + } + }, + "strategy": {}, "template": { "metadata": { - "creationTimestamp": null, - "labels": { - "io.kompose.service": "redis" - }, "annotations": { "kompose.cmd": "%CMD%", "kompose.version": "%VERSION%" + }, + "creationTimestamp": null, + "labels": { + "io.kompose.service": "redis" } }, "spec": { "containers": [ { - "name": "redis", "image": "redis:3.0", + "imagePullPolicy": "", + "name": "redis", "ports": [ { "containerPort": 6379 @@ -109,47 +116,55 @@ "resources": {} } ], - "restartPolicy": "Always" + "restartPolicy": "Always", + "serviceAccountName": "", + "volumes": null } - }, - "strategy": {} + } }, "status": {} }, { + "apiVersion": "apps/v1", "kind": "Deployment", - "apiVersion": "extensions/v1beta1", "metadata": { - "name": "web", + "annotations": { + "kompose.cmd": "%CMD%", + "kompose.service.expose": "True", + "kompose.version": "%VERSION%" + }, "creationTimestamp": null, "labels": { "io.kompose.service": "web" }, - "annotations": { - "kompose.service.expose": "True", - "kompose.cmd": "%CMD%", - "kompose.version": "%VERSION%" - } + "name": "web" }, "spec": { "replicas": 1, + "selector": { + "matchLabels": { + "io.kompose.service": "web" + } + }, + "strategy": {}, "template": { "metadata": { + "annotations": { + "kompose.cmd": "%CMD%", + "kompose.service.expose": "True", + "kompose.version": "%VERSION%" + }, "creationTimestamp": null, "labels": { "io.kompose.service": "web" - }, - "annotations": { - "kompose.service.expose": "True", - "kompose.cmd": "%CMD%", - "kompose.version": "%VERSION%" } }, "spec": { "containers": [ { - "name": "web", "image": "tuna/docker-counter23", + "imagePullPolicy": "", + "name": "web", "ports": [ { "containerPort": 5000 @@ -161,10 +176,11 @@ "resources": {} } ], - "restartPolicy": "Always" + "restartPolicy": "Always", + "serviceAccountName": "", + "volumes": null } - }, - "strategy": {} + } }, "status": {} }, 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 8db27d85..e6a2c6c8 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 @@ -44,8 +44,8 @@ }, "annotations": { "kompose.cmd": "%CMD%", - "kompose.version": "%VERSION%", - "kompose.service.expose": "True" + "kompose.service.expose": "True", + "kompose.version": "%VERSION%" } }, "spec": { @@ -65,37 +65,44 @@ } }, { + "apiVersion": "apps/v1", "kind": "Deployment", - "apiVersion": "extensions/v1beta1", "metadata": { - "name": "redis", + "annotations": { + "kompose.cmd": "%CMD%", + "kompose.version": "%VERSION%" + }, "creationTimestamp": null, "labels": { "io.kompose.service": "redis" }, - "annotations": { - "kompose.cmd": "%CMD%", - "kompose.version": "%VERSION%" - } + "name": "redis" }, "spec": { "replicas": 1, + "selector": { + "matchLabels": { + "io.kompose.service": "redis" + } + }, + "strategy": {}, "template": { "metadata": { - "creationTimestamp": null, - "labels": { - "io.kompose.service": "redis" - }, "annotations": { "kompose.cmd": "%CMD%", "kompose.version": "%VERSION%" + }, + "creationTimestamp": null, + "labels": { + "io.kompose.service": "redis" } }, "spec": { "containers": [ { - "name": "redis", "image": "redis:3.0", + "imagePullPolicy": "", + "name": "redis", "ports": [ { "containerPort": 6379 @@ -104,47 +111,55 @@ "resources": {} } ], - "restartPolicy": "Always" + "restartPolicy": "Always", + "serviceAccountName": "", + "volumes": null } - }, - "strategy": {} + } }, "status": {} }, { + "apiVersion": "apps/v1", "kind": "Deployment", - "apiVersion": "extensions/v1beta1", "metadata": { - "name": "web", + "annotations": { + "kompose.cmd": "%CMD%", + "kompose.service.expose": "True", + "kompose.version": "%VERSION%" + }, "creationTimestamp": null, "labels": { "io.kompose.service": "web" }, - "annotations": { - "kompose.cmd": "%CMD%", - "kompose.version": "%VERSION%", - "kompose.service.expose": "True" - } + "name": "web" }, "spec": { "replicas": 1, + "selector": { + "matchLabels": { + "io.kompose.service": "web" + } + }, + "strategy": {}, "template": { "metadata": { + "annotations": { + "kompose.cmd": "%CMD%", + "kompose.service.expose": "True", + "kompose.version": "%VERSION%" + }, "creationTimestamp": null, "labels": { "io.kompose.service": "web" - }, - "annotations": { - "kompose.cmd": "%CMD%", - "kompose.version": "%VERSION%", - "kompose.service.expose": "True" } }, "spec": { "containers": [ { - "name": "web", "image": "tuna/docker-counter23", + "imagePullPolicy": "", + "name": "web", "ports": [ { "containerPort": 5000 @@ -153,10 +168,11 @@ "resources": {} } ], - "restartPolicy": "Always" + "restartPolicy": "Always", + "serviceAccountName": "", + "volumes": null } - }, - "strategy": {} + } }, "status": {} }, diff --git a/script/test/fixtures/gitlab/output-k8s-template.json b/script/test/fixtures/gitlab/output-k8s-template.json index fe63e6a2..42f29a6e 100644 --- a/script/test/fixtures/gitlab/output-k8s-template.json +++ b/script/test/fixtures/gitlab/output-k8s-template.json @@ -104,48 +104,41 @@ } }, { + "apiVersion": "apps/v1", "kind": "Deployment", - "apiVersion": "extensions/v1beta1", "metadata": { - "name": "gitlab", + "annotations": { + "kompose.cmd": "%CMD%", + "kompose.version": "%VERSION%" + }, "creationTimestamp": null, "labels": { "io.kompose.service": "gitlab" }, - "annotations": { - "kompose.cmd": "%CMD%", - "kompose.version": "%VERSION%" - } + "name": "gitlab" }, "spec": { "replicas": 1, + "selector": { + "matchLabels": { + "io.kompose.service": "gitlab" + } + }, + "strategy": {}, "template": { "metadata": { - "creationTimestamp": null, - "labels": { - "io.kompose.service": "gitlab" - }, "annotations": { "kompose.cmd": "%CMD%", "kompose.version": "%VERSION%" + }, + "creationTimestamp": null, + "labels": { + "io.kompose.service": "gitlab" } }, "spec": { "containers": [ { - "name": "gitlab", - "image": "swordphilic/gitlab", - "ports": [ - { - "containerPort": 80 - }, - { - "containerPort": 443 - }, - { - "containerPort": 22 - } - ], "env": [ { "name": "DB_HOST", @@ -180,53 +173,67 @@ "value": "6379" } ], + "image": "swordphilic/gitlab", + "imagePullPolicy": "", + "name": "gitlab", + "ports": [ + { + "containerPort": 80 + }, + { + "containerPort": 443 + }, + { + "containerPort": 22 + } + ], "resources": {} } ], - "restartPolicy": "Always" + "restartPolicy": "Always", + "serviceAccountName": "", + "volumes": null } - }, - "strategy": {} + } }, "status": {} }, { + "apiVersion": "apps/v1", "kind": "Deployment", - "apiVersion": "extensions/v1beta1", "metadata": { - "name": "postgresql", + "annotations": { + "kompose.cmd": "%CMD%", + "kompose.version": "%VERSION%" + }, "creationTimestamp": null, "labels": { "io.kompose.service": "postgresql" }, - "annotations": { - "kompose.cmd": "%CMD%", - "kompose.version": "%VERSION%" - } + "name": "postgresql" }, "spec": { "replicas": 1, + "selector": { + "matchLabels": { + "io.kompose.service": "postgresql" + } + }, + "strategy": {}, "template": { "metadata": { - "creationTimestamp": null, - "labels": { - "io.kompose.service": "postgresql" - }, "annotations": { "kompose.cmd": "%CMD%", "kompose.version": "%VERSION%" + }, + "creationTimestamp": null, + "labels": { + "io.kompose.service": "postgresql" } }, "spec": { "containers": [ { - "name": "postgresql", - "image": "swordphilic/postgresql", - "ports": [ - { - "containerPort": 5432 - } - ], "env": [ { "name": "DB_NAME", @@ -241,48 +248,64 @@ "value": "gitlab" } ], + "image": "swordphilic/postgresql", + "imagePullPolicy": "", + "name": "postgresql", + "ports": [ + { + "containerPort": 5432 + } + ], "resources": {} } ], - "restartPolicy": "Always" + "restartPolicy": "Always", + "serviceAccountName": "", + "volumes": null } - }, - "strategy": {} + } }, "status": {} }, { + "apiVersion": "apps/v1", "kind": "Deployment", - "apiVersion": "extensions/v1beta1", "metadata": { - "name": "redis", + "annotations": { + "kompose.cmd": "%CMD%", + "kompose.version": "%VERSION%" + }, "creationTimestamp": null, "labels": { "io.kompose.service": "redis" }, - "annotations": { - "kompose.cmd": "%CMD%", - "kompose.version": "%VERSION%" - } + "name": "redis" }, "spec": { "replicas": 1, + "selector": { + "matchLabels": { + "io.kompose.service": "redis" + } + }, + "strategy": {}, "template": { "metadata": { - "creationTimestamp": null, - "labels": { - "io.kompose.service": "redis" - }, "annotations": { "kompose.cmd": "%CMD%", "kompose.version": "%VERSION%" + }, + "creationTimestamp": null, + "labels": { + "io.kompose.service": "redis" } }, "spec": { "containers": [ { - "name": "redis", "image": "swordphilic/redis", + "imagePullPolicy": "", + "name": "redis", "ports": [ { "containerPort": 6379 @@ -291,10 +314,11 @@ "resources": {} } ], - "restartPolicy": "Always" + "restartPolicy": "Always", + "serviceAccountName": "", + "volumes": null } - }, - "strategy": {} + } }, "status": {} } diff --git a/script/test/fixtures/group-add/output-k8s.json b/script/test/fixtures/group-add/output-k8s.json index a726e445..dba5ae40 100644 --- a/script/test/fixtures/group-add/output-k8s.json +++ b/script/test/fixtures/group-add/output-k8s.json @@ -4,37 +4,44 @@ "metadata": {}, "items": [ { + "apiVersion": "apps/v1", "kind": "Deployment", - "apiVersion": "extensions/v1beta1", "metadata": { - "name": "myservice", + "annotations": { + "kompose.cmd": "%CMD%", + "kompose.version": "%VERSION%" + }, "creationTimestamp": null, "labels": { "io.kompose.service": "myservice" }, - "annotations": { - "kompose.cmd": "%CMD%", - "kompose.version": "%VERSION%" - } + "name": "myservice" }, "spec": { "replicas": 1, + "selector": { + "matchLabels": { + "io.kompose.service": "myservice" + } + }, + "strategy": {}, "template": { "metadata": { - "creationTimestamp": null, - "labels": { - "io.kompose.service": "myservice" - }, "annotations": { "kompose.cmd": "%CMD%", "kompose.version": "%VERSION%" + }, + "creationTimestamp": null, + "labels": { + "io.kompose.service": "myservice" } }, "spec": { "containers": [ { - "name": "myservice", "image": "alpine", + "imagePullPolicy": "", + "name": "myservice", "resources": {} } ], @@ -43,10 +50,11 @@ "supplementalGroups": [ 1234 ] - } + }, + "serviceAccountName": "", + "volumes": null } - }, - "strategy": {} + } }, "status": {} } diff --git a/script/test/fixtures/healthcheck/output-k8s-template.json b/script/test/fixtures/healthcheck/output-k8s-template.json index ed611ed8..b6818624 100644 --- a/script/test/fixtures/healthcheck/output-k8s-template.json +++ b/script/test/fixtures/healthcheck/output-k8s-template.json @@ -36,56 +36,64 @@ } }, { + "apiVersion": "apps/v1", "kind": "Deployment", - "apiVersion": "extensions/v1beta1", "metadata": { - "name": "redis", - "creationTimestamp": null, - "labels": { - "io.kompose.service": "redis" - }, "annotations": { "kompose.cmd": "%CMD%", "kompose.service.type": "headless", "kompose.version": "%VERSION%" - } + }, + "creationTimestamp": null, + "labels": { + "io.kompose.service": "redis" + }, + "name": "redis" }, "spec": { "replicas": 1, + "selector": { + "matchLabels": { + "io.kompose.service": "redis" + } + }, + "strategy": {}, "template": { "metadata": { - "creationTimestamp": null, - "labels": { - "io.kompose.service": "redis" - }, "annotations": { "kompose.cmd": "%CMD%", "kompose.service.type": "headless", "kompose.version": "%VERSION%" + }, + "creationTimestamp": null, + "labels": { + "io.kompose.service": "redis" } }, "spec": { "containers": [ { - "name": "redis", "image": "redis", - "resources": {}, + "imagePullPolicy": "", "livenessProbe": { "exec": { "command": [ "echo \"hello world\"" ] }, - "timeoutSeconds": 1, + "failureThreshold": 5, "periodSeconds": 10, - "failureThreshold": 5 - } + "timeoutSeconds": 1 + }, + "name": "redis", + "resources": {} } ], - "restartPolicy": "Always" + "restartPolicy": "Always", + "serviceAccountName": "", + "volumes": null } - }, - "strategy": {} + } }, "status": {} } diff --git a/script/test/fixtures/healthcheck/output-only-command-k8s-template.json b/script/test/fixtures/healthcheck/output-only-command-k8s-template.json index a66af93c..c02dbe8c 100644 --- a/script/test/fixtures/healthcheck/output-only-command-k8s-template.json +++ b/script/test/fixtures/healthcheck/output-only-command-k8s-template.json @@ -36,53 +36,61 @@ } }, { + "apiVersion": "apps/v1", "kind": "Deployment", - "apiVersion": "extensions/v1beta1", "metadata": { - "name": "redis", - "creationTimestamp": null, - "labels": { - "io.kompose.service": "redis" - }, "annotations": { "kompose.cmd": "%CMD%", "kompose.service.type": "headless", "kompose.version": "%VERSION%" - } + }, + "creationTimestamp": null, + "labels": { + "io.kompose.service": "redis" + }, + "name": "redis" }, "spec": { "replicas": 1, + "selector": { + "matchLabels": { + "io.kompose.service": "redis" + } + }, + "strategy": {}, "template": { "metadata": { - "creationTimestamp": null, - "labels": { - "io.kompose.service": "redis" - }, "annotations": { "kompose.cmd": "%CMD%", "kompose.service.type": "headless", "kompose.version": "%VERSION%" + }, + "creationTimestamp": null, + "labels": { + "io.kompose.service": "redis" } }, "spec": { "containers": [ { - "name": "redis", "image": "redis", - "resources": {}, + "imagePullPolicy": "", "livenessProbe": { "exec": { "command": [ "echo \"hello world\"" ] } - } + }, + "name": "redis", + "resources": {} } ], - "restartPolicy": "Always" + "restartPolicy": "Always", + "serviceAccountName": "", + "volumes": null } - }, - "strategy": {} + } }, "status": {} } diff --git a/script/test/fixtures/image-pull-policy/provider-files/kubernetes-v12-image-pull-policy.json b/script/test/fixtures/image-pull-policy/provider-files/kubernetes-v12-image-pull-policy.json index 8da86c20..7b2ea6b2 100644 --- a/script/test/fixtures/image-pull-policy/provider-files/kubernetes-v12-image-pull-policy.json +++ b/script/test/fixtures/image-pull-policy/provider-files/kubernetes-v12-image-pull-policy.json @@ -4,47 +4,54 @@ "metadata": {}, "items": [ { + "apiVersion": "apps/v1", "kind": "Deployment", - "apiVersion": "extensions/v1beta1", "metadata": { - "name": "nginx0", - "creationTimestamp": null, - "labels": { - "io.kompose.service": "nginx0" - }, "annotations": { "kompose.cmd": "%CMD%", "kompose.image-pull-policy": "Always", "kompose.version": "%VERSION%" - } + }, + "creationTimestamp": null, + "labels": { + "io.kompose.service": "nginx0" + }, + "name": "nginx0" }, "spec": { "replicas": 1, + "selector": { + "matchLabels": { + "io.kompose.service": "nginx0" + } + }, + "strategy": {}, "template": { "metadata": { - "creationTimestamp": null, - "labels": { - "io.kompose.service": "nginx0" - }, "annotations": { "kompose.cmd": "%CMD%", "kompose.image-pull-policy": "Always", "kompose.version": "%VERSION%" + }, + "creationTimestamp": null, + "labels": { + "io.kompose.service": "nginx0" } }, "spec": { "containers": [ { - "name": "nginx0", "image": "nginx", - "resources": {}, - "imagePullPolicy": "Always" + "imagePullPolicy": "Always", + "name": "nginx0", + "resources": {} } ], - "restartPolicy": "Always" + "restartPolicy": "Always", + "serviceAccountName": "", + "volumes": null } - }, - "strategy": {} + } }, "status": {} } diff --git a/script/test/fixtures/image-pull-policy/provider-files/kubernetes-v3-image-pull-policy.json b/script/test/fixtures/image-pull-policy/provider-files/kubernetes-v3-image-pull-policy.json index dd6ec9b3..8e5f265e 100644 --- a/script/test/fixtures/image-pull-policy/provider-files/kubernetes-v3-image-pull-policy.json +++ b/script/test/fixtures/image-pull-policy/provider-files/kubernetes-v3-image-pull-policy.json @@ -4,137 +4,158 @@ "metadata": {}, "items": [ { + "apiVersion": "apps/v1", "kind": "Deployment", - "apiVersion": "extensions/v1beta1", "metadata": { - "name": "nginx0", - "creationTimestamp": null, - "labels": { - "io.kompose.service": "nginx0" - }, "annotations": { "kompose.cmd": "%CMD%", "kompose.image-pull-policy": "Always", "kompose.version": "%VERSION%" - } + }, + "creationTimestamp": null, + "labels": { + "io.kompose.service": "nginx0" + }, + "name": "nginx0" }, "spec": { "replicas": 1, + "selector": { + "matchLabels": { + "io.kompose.service": "nginx0" + } + }, + "strategy": {}, "template": { "metadata": { - "creationTimestamp": null, - "labels": { - "io.kompose.service": "nginx0" - }, "annotations": { "kompose.cmd": "%CMD%", "kompose.image-pull-policy": "Always", "kompose.version": "%VERSION%" + }, + "creationTimestamp": null, + "labels": { + "io.kompose.service": "nginx0" } }, "spec": { "containers": [ { - "name": "nginx0", "image": "nginx", - "resources": {}, - "imagePullPolicy": "Always" + "imagePullPolicy": "Always", + "name": "nginx0", + "resources": {} } ], - "restartPolicy": "Always" + "restartPolicy": "Always", + "serviceAccountName": "", + "volumes": null } - }, - "strategy": {} + } }, "status": {} }, { + "apiVersion": "apps/v1", "kind": "Deployment", - "apiVersion": "extensions/v1beta1", "metadata": { - "name": "nginx1", - "creationTimestamp": null, - "labels": { - "io.kompose.service": "nginx1" - }, "annotations": { "kompose.cmd": "%CMD%", "kompose.image-pull-policy": "IfNotPresent", "kompose.version": "%VERSION%" - } + }, + "creationTimestamp": null, + "labels": { + "io.kompose.service": "nginx1" + }, + "name": "nginx1" }, "spec": { "replicas": 1, + "selector": { + "matchLabels": { + "io.kompose.service": "nginx1" + } + }, + "strategy": {}, "template": { "metadata": { - "creationTimestamp": null, - "labels": { - "io.kompose.service": "nginx1" - }, "annotations": { "kompose.cmd": "%CMD%", "kompose.image-pull-policy": "IfNotPresent", "kompose.version": "%VERSION%" + }, + "creationTimestamp": null, + "labels": { + "io.kompose.service": "nginx1" } }, "spec": { "containers": [ { - "name": "nginx1", "image": "nginx", - "resources": {}, - "imagePullPolicy": "IfNotPresent" + "imagePullPolicy": "IfNotPresent", + "name": "nginx1", + "resources": {} } ], - "restartPolicy": "Always" + "restartPolicy": "Always", + "serviceAccountName": "", + "volumes": null } - }, - "strategy": {} + } }, "status": {} }, { + "apiVersion": "apps/v1", "kind": "Deployment", - "apiVersion": "extensions/v1beta1", "metadata": { - "name": "nginx2", - "creationTimestamp": null, - "labels": { - "io.kompose.service": "nginx2" - }, "annotations": { "kompose.cmd": "%CMD%", "kompose.image-pull-policy": "Never", "kompose.version": "%VERSION%" - } + }, + "creationTimestamp": null, + "labels": { + "io.kompose.service": "nginx2" + }, + "name": "nginx2" }, "spec": { "replicas": 1, + "selector": { + "matchLabels": { + "io.kompose.service": "nginx2" + } + }, + "strategy": {}, "template": { "metadata": { - "creationTimestamp": null, - "labels": { - "io.kompose.service": "nginx2" - }, "annotations": { "kompose.cmd": "%CMD%", "kompose.image-pull-policy": "Never", "kompose.version": "%VERSION%" + }, + "creationTimestamp": null, + "labels": { + "io.kompose.service": "nginx2" } }, "spec": { "containers": [ { - "name": "nginx2", "image": "nginx", - "resources": {}, - "imagePullPolicy": "Never" + "imagePullPolicy": "Never", + "name": "nginx2", + "resources": {} } ], - "restartPolicy": "Always" + "restartPolicy": "Always", + "serviceAccountName": "", + "volumes": null } - }, - "strategy": {} + } }, "status": {} } diff --git a/script/test/fixtures/image-pull-secret/provider-files/kubernetes-image-pull-secret.json b/script/test/fixtures/image-pull-secret/provider-files/kubernetes-image-pull-secret.json index 67e8f6dd..b538ec02 100644 --- a/script/test/fixtures/image-pull-secret/provider-files/kubernetes-image-pull-secret.json +++ b/script/test/fixtures/image-pull-secret/provider-files/kubernetes-image-pull-secret.json @@ -4,93 +4,109 @@ "metadata": {}, "items": [ { + "apiVersion": "apps/v1", "kind": "Deployment", - "apiVersion": "extensions/v1beta1", "metadata": { - "name": "open-image-service", + "annotations": { + "kompose.cmd": "%CMD%", + "kompose.version": "%VERSION%" + }, "creationTimestamp": null, "labels": { "io.kompose.service": "open-image-service" }, - "annotations": { - "kompose.cmd": "%CMD%", - "kompose.version": "%VERSION%" - } + "name": "open-image-service" }, "spec": { "replicas": 1, + "selector": { + "matchLabels": { + "io.kompose.service": "open-image-service" + } + }, + "strategy": {}, "template": { "metadata": { + "annotations": { + "kompose.cmd": "%CMD%", + "kompose.version": "%VERSION%" + }, "creationTimestamp": null, "labels": { "io.kompose.service": "open-image-service" - }, - "annotations": { - "kompose.cmd": "%CMD%", - "kompose.version": "%VERSION%" } }, "spec": { "containers": [ { - "name": "open-image-service", "image": "nginx-alpine", - "resources": {} - } - ], - "restartPolicy": "Always" - } - }, - "strategy": {} - }, - "status": {} - }, - { - "kind": "Deployment", - "apiVersion": "extensions/v1beta1", - "metadata": { - "name": "tm-image-service", - "creationTimestamp": null, - "labels": { - "io.kompose.service": "tm-image-service" - }, - "annotations": { - "kompose.cmd": "%CMD%", - "kompose.image-pull-secret": "sample-k8s-secret-name", - "kompose.version": "%VERSION%" - } - }, - "spec": { - "replicas": 1, - "template": { - "metadata": { - "creationTimestamp": null, - "labels": { - "io.kompose.service": "tm-image-service" - }, - "annotations": { - "kompose.cmd": "%CMD%", - "kompose.image-pull-secret": "sample-k8s-secret-name", - "kompose.version": "%VERSION%" - } - }, - "spec": { - "containers": [ - { - "name": "tm-image-service", - "image": "premium/private-image", + "imagePullPolicy": "", + "name": "open-image-service", "resources": {} } ], "restartPolicy": "Always", - "imagePullSecrets": [ - { - "name": "sample-k8s-secret-name" - } - ] + "serviceAccountName": "", + "volumes": null + } + } + }, + "status": {} + }, + { + "apiVersion": "apps/v1", + "kind": "Deployment", + "metadata": { + "annotations": { + "kompose.cmd": "%CMD%", + "kompose.image-pull-secret": "sample-k8s-secret-name", + "kompose.version": "%VERSION%" + }, + "creationTimestamp": null, + "labels": { + "io.kompose.service": "tm-image-service" + }, + "name": "tm-image-service" + }, + "spec": { + "replicas": 1, + "selector": { + "matchLabels": { + "io.kompose.service": "tm-image-service" } }, - "strategy": {} + "strategy": {}, + "template": { + "metadata": { + "annotations": { + "kompose.cmd": "%CMD%", + "kompose.image-pull-secret": "sample-k8s-secret-name", + "kompose.version": "%VERSION%" + }, + "creationTimestamp": null, + "labels": { + "io.kompose.service": "tm-image-service" + } + }, + "spec": { + "containers": [ + { + "image": "premium/private-image", + "imagePullPolicy": "", + "name": "tm-image-service", + "resources": {} + } + ], + "imagePullSecrets": [ + { + "Name": "sample-k8s-secret-name" + } + ], + "restartPolicy": "Always", + "serviceAccountName": "", + "volumes": null + } + } }, "status": {} } diff --git a/script/test/fixtures/keyonly-envs/output-k8s-template.json b/script/test/fixtures/keyonly-envs/output-k8s-template.json index 53574d35..165772a6 100644 --- a/script/test/fixtures/keyonly-envs/output-k8s-template.json +++ b/script/test/fixtures/keyonly-envs/output-k8s-template.json @@ -94,102 +94,117 @@ } }, { + "apiVersion": "apps/v1", "kind": "Deployment", - "apiVersion": "extensions/v1beta1", "metadata": { - "name": "frontend", + "annotations": { + "kompose.cmd": "%CMD%", + "kompose.version": "%VERSION%" + }, "creationTimestamp": null, "labels": { "io.kompose.service": "frontend" }, - "annotations": { - "kompose.cmd": "%CMD%", - "kompose.version": "%VERSION%" - } + "name": "frontend" }, "spec": { "replicas": 1, + "selector": { + "matchLabels": { + "io.kompose.service": "frontend" + } + }, + "strategy": {}, "template": { "metadata": { - "creationTimestamp": null, - "labels": { - "io.kompose.service": "frontend" - }, "annotations": { "kompose.cmd": "%CMD%", "kompose.version": "%VERSION%" + }, + "creationTimestamp": null, + "labels": { + "io.kompose.service": "frontend" } }, "spec": { "containers": [ { - "name": "frontend", + "env": [ + { + "name": "GET_HOSTS_FROM", + "value": "dns" + }, + { + "name": "RACK_ENV", + "value": "development" + }, + { + "name": "SESSION_SECRET", + "value": "session" + }, + { + "name": "SHOW", + "value": "true" + } + ], "image": "gcr.io/google-samples/gb-frontend:v4", + "imagePullPolicy": "", + "name": "frontend", "ports": [ { "containerPort": 80 } ], - "env": [ - { - "name": "GET_HOSTS_FROM", - "value": "dns" - }, - { - "name": "RACK_ENV", - "value": "development" - }, - { - "name": "SESSION_SECRET", - "value": "session" - }, - { - "name": "SHOW", - "value": "true" - } - ], "resources": {} } ], - "restartPolicy": "Always" + "restartPolicy": "Always", + "serviceAccountName": "", + "volumes": null } - }, - "strategy": {} + } }, "status": {} }, { + "apiVersion": "apps/v1", "kind": "Deployment", - "apiVersion": "extensions/v1beta1", "metadata": { - "name": "redis-master", + "annotations": { + "kompose.cmd": "%CMD%", + "kompose.version": "%VERSION%" + }, "creationTimestamp": null, "labels": { "io.kompose.service": "redis-master" }, - "annotations": { - "kompose.cmd": "%CMD%", - "kompose.version": "%VERSION%" - } + "name": "redis-master" }, "spec": { "replicas": 1, + "selector": { + "matchLabels": { + "io.kompose.service": "redis-master" + } + }, + "strategy": {}, "template": { "metadata": { - "creationTimestamp": null, - "labels": { - "io.kompose.service": "redis-master" - }, "annotations": { "kompose.cmd": "%CMD%", "kompose.version": "%VERSION%" + }, + "creationTimestamp": null, + "labels": { + "io.kompose.service": "redis-master" } }, "spec": { "containers": [ { - "name": "redis-master", "image": "k8s.gcr.io/redis:e2e", + "imagePullPolicy": "", + "name": "redis-master", "ports": [ { "containerPort": 6379 @@ -198,50 +213,50 @@ "resources": {} } ], - "restartPolicy": "Always" + "restartPolicy": "Always", + "serviceAccountName": "", + "volumes": null } - }, - "strategy": {} + } }, "status": {} }, { + "apiVersion": "apps/v1", "kind": "Deployment", - "apiVersion": "extensions/v1beta1", "metadata": { - "name": "redis-slave", + "annotations": { + "kompose.cmd": "%CMD%", + "kompose.version": "%VERSION%" + }, "creationTimestamp": null, "labels": { "io.kompose.service": "redis-slave" }, - "annotations": { - "kompose.cmd": "%CMD%", - "kompose.version": "%VERSION%" - } + "name": "redis-slave" }, "spec": { "replicas": 1, + "selector": { + "matchLabels": { + "io.kompose.service": "redis-slave" + } + }, + "strategy": {}, "template": { "metadata": { - "creationTimestamp": null, - "labels": { - "io.kompose.service": "redis-slave" - }, "annotations": { "kompose.cmd": "%CMD%", "kompose.version": "%VERSION%" + }, + "creationTimestamp": null, + "labels": { + "io.kompose.service": "redis-slave" } }, "spec": { "containers": [ { - "name": "redis-slave", - "image": "gcr.io/google_samples/gb-redisslave:v1", - "ports": [ - { - "containerPort": 6379 - } - ], "env": [ { "name": "GET_HOSTS_FROM", @@ -260,13 +275,22 @@ "value": "true" } ], + "image": "gcr.io/google_samples/gb-redisslave:v1", + "imagePullPolicy": "", + "name": "redis-slave", + "ports": [ + { + "containerPort": 6379 + } + ], "resources": {} } ], - "restartPolicy": "Always" + "restartPolicy": "Always", + "serviceAccountName": "", + "volumes": null } - }, - "strategy": {} + } }, "status": {} } diff --git a/script/test/fixtures/mem-limit/output-k8s-template.json b/script/test/fixtures/mem-limit/output-k8s-template.json index bf956516..c744e760 100644 --- a/script/test/fixtures/mem-limit/output-k8s-template.json +++ b/script/test/fixtures/mem-limit/output-k8s-template.json @@ -40,37 +40,44 @@ } }, { + "apiVersion": "apps/v1", "kind": "Deployment", - "apiVersion": "extensions/v1beta1", "metadata": { - "name": "redis", + "annotations": { + "kompose.cmd": "%CMD%", + "kompose.version": "%VERSION%" + }, "creationTimestamp": null, "labels": { "io.kompose.service": "redis" }, - "annotations": { - "kompose.cmd": "%CMD%", - "kompose.version": "%VERSION%" - } + "name": "redis" }, "spec": { "replicas": 1, + "selector": { + "matchLabels": { + "io.kompose.service": "redis" + } + }, + "strategy": {}, "template": { "metadata": { - "creationTimestamp": null, - "labels": { - "io.kompose.service": "redis" - }, "annotations": { "kompose.cmd": "%CMD%", "kompose.version": "%VERSION%" + }, + "creationTimestamp": null, + "labels": { + "io.kompose.service": "redis" } }, "spec": { "containers": [ { - "name": "redis", "image": "redis:3.0", + "imagePullPolicy": "", + "name": "redis", "ports": [ { "containerPort": 6379 @@ -87,10 +94,11 @@ } } ], - "restartPolicy": "Always" + "restartPolicy": "Always", + "serviceAccountName": "", + "volumes": null } - }, - "strategy": {} + } }, "status": {} } diff --git a/script/test/fixtures/mem-limit/output-mb-k8s-template.json b/script/test/fixtures/mem-limit/output-mb-k8s-template.json index f82a8d0b..5696f306 100644 --- a/script/test/fixtures/mem-limit/output-mb-k8s-template.json +++ b/script/test/fixtures/mem-limit/output-mb-k8s-template.json @@ -40,37 +40,44 @@ } }, { + "apiVersion": "apps/v1", "kind": "Deployment", - "apiVersion": "extensions/v1beta1", "metadata": { - "name": "redis", + "annotations": { + "kompose.cmd": "%CMD%", + "kompose.version": "%VERSION%" + }, "creationTimestamp": null, "labels": { "io.kompose.service": "redis" }, - "annotations": { - "kompose.cmd": "%CMD%", - "kompose.version": "%VERSION%" - } + "name": "redis" }, "spec": { "replicas": 1, + "selector": { + "matchLabels": { + "io.kompose.service": "redis" + } + }, + "strategy": {}, "template": { "metadata": { - "creationTimestamp": null, - "labels": { - "io.kompose.service": "redis" - }, "annotations": { "kompose.cmd": "%CMD%", "kompose.version": "%VERSION%" + }, + "creationTimestamp": null, + "labels": { + "io.kompose.service": "redis" } }, "spec": { "containers": [ { - "name": "redis", "image": "redis:3.0", + "imagePullPolicy": "", + "name": "redis", "ports": [ { "containerPort": 6379 @@ -87,10 +94,11 @@ } } ], - "restartPolicy": "Always" + "restartPolicy": "Always", + "serviceAccountName": "", + "volumes": null } - }, - "strategy": {} + } }, "status": {} } diff --git a/script/test/fixtures/merge-multiple-compose/output-base-template.json b/script/test/fixtures/merge-multiple-compose/output-base-template.json index 40e220ce..eadd8831 100644 --- a/script/test/fixtures/merge-multiple-compose/output-base-template.json +++ b/script/test/fixtures/merge-multiple-compose/output-base-template.json @@ -4,37 +4,41 @@ "metadata": {}, "items": [ { + "apiVersion": "apps/v1", "kind": "Deployment", - "apiVersion": "extensions/v1beta1", "metadata": { - "name": "web", + "annotations": { + "kompose.cmd": "%CMD%", + "kompose.version": "%VERSION%" + }, "creationTimestamp": null, "labels": { "io.kompose.service": "web" }, - "annotations": { - "kompose.cmd": "%CMD%", - "kompose.version": "%VERSION%" - } + "name": "web" }, "spec": { "replicas": 1, + "selector": { + "matchLabels": { + "io.kompose.service": "web" + } + }, + "strategy": {}, "template": { "metadata": { - "creationTimestamp": null, - "labels": { - "io.kompose.service": "web" - }, "annotations": { "kompose.cmd": "%CMD%", "kompose.version": "%VERSION%" + }, + "creationTimestamp": null, + "labels": { + "io.kompose.service": "web" } }, "spec": { "containers": [ { - "name": "web", - "image": "richarvey/nginx-php-fpm", "env": [ { "name": "ENABLE_XDEBUG", @@ -61,13 +65,17 @@ "value": "1" } ], + "image": "richarvey/nginx-php-fpm", + "imagePullPolicy": "", + "name": "web", "resources": {} } ], - "restartPolicy": "Always" + "restartPolicy": "Always", + "serviceAccountName": "", + "volumes": null } - }, - "strategy": {} + } }, "status": {} } diff --git a/script/test/fixtures/merge-multiple-compose/output-compose-new-service-template.json b/script/test/fixtures/merge-multiple-compose/output-compose-new-service-template.json index 4de33718..1bfc4934 100644 --- a/script/test/fixtures/merge-multiple-compose/output-compose-new-service-template.json +++ b/script/test/fixtures/merge-multiple-compose/output-compose-new-service-template.json @@ -34,79 +34,94 @@ } }, { + "apiVersion": "apps/v1", "kind": "Deployment", - "apiVersion": "extensions/v1beta1", "metadata": { - "name": "new-my-service", + "annotations": { + "kompose.cmd": "%CMD%", + "kompose.version": "%VERSION%" + }, "creationTimestamp": null, "labels": { "io.kompose.service": "new-my-service" }, - "annotations": { - "kompose.cmd": "%CMD%", - "kompose.version": "%VERSION%" - } + "name": "new-my-service" }, "spec": { "replicas": 1, + "selector": { + "matchLabels": { + "io.kompose.service": "new-my-service" + } + }, + "strategy": {}, "template": { "metadata": { - "creationTimestamp": null, - "labels": { - "io.kompose.service": "new-my-service" - }, "annotations": { "kompose.cmd": "%CMD%", "kompose.version": "%VERSION%" + }, + "creationTimestamp": null, + "labels": { + "io.kompose.service": "new-my-service" } }, "spec": { "containers": [ { - "name": "new-my-service", "image": "nginx", + "imagePullPolicy": "", + "name": "new-my-service", "resources": {} } ], - "restartPolicy": "Always" + "restartPolicy": "Always", + "serviceAccountName": "", + "volumes": null } - }, - "strategy": {} + } }, "status": {} }, { + "apiVersion": "apps/v1", "kind": "Deployment", - "apiVersion": "extensions/v1beta1", "metadata": { - "name": "server", + "annotations": { + "kompose.cmd": "%CMD%", + "kompose.version": "%VERSION%" + }, "creationTimestamp": null, "labels": { "io.kompose.service": "server" }, - "annotations": { - "kompose.cmd": "%CMD%", - "kompose.version": "%VERSION%" - } + "name": "server" }, "spec": { "replicas": 1, + "selector": { + "matchLabels": { + "io.kompose.service": "server" + } + }, + "strategy": {}, "template": { "metadata": { - "creationTimestamp": null, - "labels": { - "io.kompose.service": "server" - }, "annotations": { "kompose.cmd": "%CMD%", "kompose.version": "%VERSION%" + }, + "creationTimestamp": null, + "labels": { + "io.kompose.service": "server" } }, "spec": { "containers": [ { - "name": "test-server", "image": "test", + "imagePullPolicy": "", + "name": "test-server", "ports": [ { "containerPort": 5000 @@ -115,10 +130,11 @@ "resources": {} } ], - "restartPolicy": "Always" + "restartPolicy": "Always", + "serviceAccountName": "", + "volumes": null } - }, - "strategy": {} + } }, "status": {} } diff --git a/script/test/fixtures/merge-multiple-compose/output-compose-port-template.json b/script/test/fixtures/merge-multiple-compose/output-compose-port-template.json index 5f8ad568..6047f263 100644 --- a/script/test/fixtures/merge-multiple-compose/output-compose-port-template.json +++ b/script/test/fixtures/merge-multiple-compose/output-compose-port-template.json @@ -34,37 +34,44 @@ } }, { + "apiVersion": "apps/v1", "kind": "Deployment", - "apiVersion": "extensions/v1beta1", "metadata": { - "name": "server", + "annotations": { + "kompose.cmd": "%CMD%", + "kompose.version": "%VERSION%" + }, "creationTimestamp": null, "labels": { "io.kompose.service": "server" }, - "annotations": { - "kompose.cmd": "%CMD%", - "kompose.version": "%VERSION%" - } + "name": "server" }, "spec": { "replicas": 1, + "selector": { + "matchLabels": { + "io.kompose.service": "server" + } + }, + "strategy": {}, "template": { "metadata": { - "creationTimestamp": null, - "labels": { - "io.kompose.service": "server" - }, "annotations": { "kompose.cmd": "%CMD%", "kompose.version": "%VERSION%" + }, + "creationTimestamp": null, + "labels": { + "io.kompose.service": "server" } }, "spec": { "containers": [ { - "name": "test-server", "image": "test", + "imagePullPolicy": "", + "name": "test-server", "ports": [ { "containerPort": 5000 @@ -73,10 +80,11 @@ "resources": {} } ], - "restartPolicy": "Always" + "restartPolicy": "Always", + "serviceAccountName": "", + "volumes": null } - }, - "strategy": {} + } }, "status": {} } diff --git a/script/test/fixtures/merge-multiple-compose/output-openshift-template.json b/script/test/fixtures/merge-multiple-compose/output-openshift-template.json index 7a93c779..36dba3a5 100644 --- a/script/test/fixtures/merge-multiple-compose/output-openshift-template.json +++ b/script/test/fixtures/merge-multiple-compose/output-openshift-template.json @@ -219,4 +219,4 @@ } } ] -} \ No newline at end of file +} diff --git a/script/test/fixtures/merge-multiple-compose/output-other-toplevel-merge-template.json b/script/test/fixtures/merge-multiple-compose/output-other-toplevel-merge-template.json index 2d3cfa7a..7fe7cd2f 100644 --- a/script/test/fixtures/merge-multiple-compose/output-other-toplevel-merge-template.json +++ b/script/test/fixtures/merge-multiple-compose/output-other-toplevel-merge-template.json @@ -18,40 +18,68 @@ } }, { + "apiVersion": "apps/v1", "kind": "Deployment", - "apiVersion": "extensions/v1beta1", "metadata": { - "name": "other-toplevel-dev", + "annotations": { + "kompose.cmd": "%CMD%", + "kompose.version": "%VERSION%" + }, "creationTimestamp": null, "labels": { "io.kompose.service": "other-toplevel-dev" }, - "annotations": { - "kompose.cmd": "%CMD%", - "kompose.version": "%VERSION%" - } + "name": "other-toplevel-dev" }, "spec": { "replicas": 1, + "selector": { + "matchLabels": { + "io.kompose.service": "other-toplevel-dev" + } + }, + "strategy": { + "type": "Recreate" + }, "template": { "metadata": { + "annotations": { + "kompose.cmd": "%CMD%", + "kompose.version": "%VERSION%" + }, "creationTimestamp": null, "labels": { "io.kompose.service": "other-toplevel-dev" - }, - "annotations": { - "kompose.cmd": "%CMD%", - "kompose.version": "%VERSION%" } }, "spec": { + "containers": [ + { + "image": "nginx", + "imagePullPolicy": "", + "name": "other-toplevel-dev", + "resources": {}, + "volumeMounts": [ + { + "mountPath": "/nginx.conf", + "name": "firstconfig" + }, + { + "mountPath": "/var/www/nginx", + "name": "firstvolume" + } + ] + } + ], + "restartPolicy": "Always", + "serviceAccountName": "", "volumes": [ { - "name": "firstconfig", "configMap": { - "name": "firstconfig", + "Name": "firstconfig", "defaultMode": 644 - } + }, + "name": "firstconfig" }, { "name": "firstvolume", @@ -59,29 +87,8 @@ "claimName": "firstvolume" } } - ], - "containers": [ - { - "name": "other-toplevel-dev", - "image": "nginx", - "resources": {}, - "volumeMounts": [ - { - "name": "firstconfig", - "mountPath": "/nginx.conf" - }, - { - "name": "firstvolume", - "mountPath": "/var/www/nginx" - } - ] - } - ], - "restartPolicy": "Always" + ] } - }, - "strategy": { - "type": "Recreate" } }, "status": {} @@ -123,40 +130,68 @@ } }, { + "apiVersion": "apps/v1", "kind": "Deployment", - "apiVersion": "extensions/v1beta1", "metadata": { - "name": "other-toplevel-second", + "annotations": { + "kompose.cmd": "%CMD%", + "kompose.version": "%VERSION%" + }, "creationTimestamp": null, "labels": { "io.kompose.service": "other-toplevel-second" }, - "annotations": { - "kompose.cmd": "%CMD%", - "kompose.version": "%VERSION%" - } + "name": "other-toplevel-second" }, "spec": { "replicas": 1, + "selector": { + "matchLabels": { + "io.kompose.service": "other-toplevel-second" + } + }, + "strategy": { + "type": "Recreate" + }, "template": { "metadata": { + "annotations": { + "kompose.cmd": "%CMD%", + "kompose.version": "%VERSION%" + }, "creationTimestamp": null, "labels": { "io.kompose.service": "other-toplevel-second" - }, - "annotations": { - "kompose.cmd": "%CMD%", - "kompose.version": "%VERSION%" } }, "spec": { + "containers": [ + { + "image": "nginx", + "imagePullPolicy": "", + "name": "other-toplevel-second", + "resources": {}, + "volumeMounts": [ + { + "mountPath": "/nginx.conf", + "name": "secondconfig" + }, + { + "mountPath": "/var/www/nginx", + "name": "secondvolume" + } + ] + } + ], + "restartPolicy": "Always", + "serviceAccountName": "", "volumes": [ { - "name": "secondconfig", "configMap": { - "name": "secondconfig", + "Name": "secondconfig", "defaultMode": 644 - } + }, + "name": "secondconfig" }, { "name": "secondvolume", @@ -164,29 +199,8 @@ "claimName": "secondvolume" } } - ], - "containers": [ - { - "name": "other-toplevel-second", - "image": "nginx", - "resources": {}, - "volumeMounts": [ - { - "name": "secondconfig", - "mountPath": "/nginx.conf" - }, - { - "name": "secondvolume", - "mountPath": "/var/www/nginx" - } - ] - } - ], - "restartPolicy": "Always" + ] } - }, - "strategy": { - "type": "Recreate" } }, "status": {} diff --git a/script/test/fixtures/merge-multiple-compose/output-other-toplevel-override-template.json b/script/test/fixtures/merge-multiple-compose/output-other-toplevel-override-template.json index b7354e1b..0298004a 100644 --- a/script/test/fixtures/merge-multiple-compose/output-other-toplevel-override-template.json +++ b/script/test/fixtures/merge-multiple-compose/output-other-toplevel-override-template.json @@ -18,40 +18,68 @@ } }, { + "apiVersion": "apps/v1", "kind": "Deployment", - "apiVersion": "extensions/v1beta1", "metadata": { - "name": "other-toplevel-base", + "annotations": { + "kompose.cmd": "%CMD%", + "kompose.version": "%VERSION%" + }, "creationTimestamp": null, "labels": { "io.kompose.service": "other-toplevel-base" }, - "annotations": { - "kompose.cmd": "%CMD%", - "kompose.version": "%VERSION%" - } + "name": "other-toplevel-base" }, "spec": { "replicas": 1, + "selector": { + "matchLabels": { + "io.kompose.service": "other-toplevel-base" + } + }, + "strategy": { + "type": "Recreate" + }, "template": { "metadata": { + "annotations": { + "kompose.cmd": "%CMD%", + "kompose.version": "%VERSION%" + }, "creationTimestamp": null, "labels": { "io.kompose.service": "other-toplevel-base" - }, - "annotations": { - "kompose.cmd": "%CMD%", - "kompose.version": "%VERSION%" } }, "spec": { + "containers": [ + { + "image": "nginx", + "imagePullPolicy": "", + "name": "other-toplevel-base", + "resources": {}, + "volumeMounts": [ + { + "mountPath": "/nginx.conf", + "name": "firstconfig" + }, + { + "mountPath": "/var/www/nginx", + "name": "firstvolume" + } + ] + } + ], + "restartPolicy": "Always", + "serviceAccountName": "", "volumes": [ { - "name": "firstconfig", "configMap": { - "name": "firstconfig", + "Name": "firstconfig", "defaultMode": 644 - } + }, + "name": "firstconfig" }, { "name": "firstvolume", @@ -59,29 +87,8 @@ "claimName": "firstvolume" } } - ], - "containers": [ - { - "name": "other-toplevel-base", - "image": "nginx", - "resources": {}, - "volumeMounts": [ - { - "name": "firstconfig", - "mountPath": "/nginx.conf" - }, - { - "name": "firstvolume", - "mountPath": "/var/www/nginx" - } - ] - } - ], - "restartPolicy": "Always" + ] } - }, - "strategy": { - "type": "Recreate" } }, "status": {} diff --git a/script/test/fixtures/multiple-compose-files/output-k8s-template.json b/script/test/fixtures/multiple-compose-files/output-k8s-template.json index 1439d1fa..a2c66cea 100644 --- a/script/test/fixtures/multiple-compose-files/output-k8s-template.json +++ b/script/test/fixtures/multiple-compose-files/output-k8s-template.json @@ -74,45 +74,41 @@ } }, { + "apiVersion": "apps/v1", "kind": "Deployment", - "apiVersion": "extensions/v1beta1", "metadata": { - "name": "etherpad", + "annotations": { + "kompose.cmd": "%CMD%", + "kompose.version": "%VERSION%" + }, "creationTimestamp": null, "labels": { "io.kompose.service": "etherpad" }, - "annotations": { - "kompose.cmd": "%CMD%", - "kompose.version": "%VERSION%" - } + "name": "etherpad" }, "spec": { "replicas": 1, + "selector": { + "matchLabels": { + "io.kompose.service": "etherpad" + } + }, + "strategy": {}, "template": { "metadata": { - "creationTimestamp": null, - "labels": { - "io.kompose.service": "etherpad" - }, "annotations": { "kompose.cmd": "%CMD%", "kompose.version": "%VERSION%" + }, + "creationTimestamp": null, + "labels": { + "io.kompose.service": "etherpad" } }, "spec": { "containers": [ { - "name": "etherpad", - "image": "centos/etherpad", - "ports": [ - { - "containerPort": 9001 - }, - { - "containerPort": 9001 - } - ], "env": [ { "name": "DB_DBID", @@ -135,70 +131,66 @@ "value": "openshift" } ], + "image": "centos/etherpad", + "imagePullPolicy": "", + "name": "etherpad", + "ports": [ + { + "containerPort": 9001 + }, + { + "containerPort": 9001 + } + ], "resources": {} } ], - "restartPolicy": "Always" + "restartPolicy": "Always", + "serviceAccountName": "", + "volumes": null } - }, - "strategy": {} + } }, "status": {} }, { + "apiVersion": "apps/v1", "kind": "Deployment", - "apiVersion": "extensions/v1beta1", "metadata": { - "name": "mariadb", + "annotations": { + "kompose.cmd": "%CMD%", + "kompose.version": "%VERSION%" + }, "creationTimestamp": null, "labels": { "io.kompose.service": "mariadb" }, - "annotations": { - "kompose.cmd": "%CMD%", - "kompose.version": "%VERSION%" - } + "name": "mariadb" }, "spec": { "replicas": 1, + "selector": { + "matchLabels": { + "io.kompose.service": "mariadb" + } + }, + "strategy": { + "type": "Recreate" + }, "template": { "metadata": { - "creationTimestamp": null, - "labels": { - "io.kompose.service": "mariadb" - }, "annotations": { "kompose.cmd": "%CMD%", "kompose.version": "%VERSION%" + }, + "creationTimestamp": null, + "labels": { + "io.kompose.service": "mariadb" } }, "spec": { - "volumes": [ - { - "name": "mariadb-claim0", - "persistentVolumeClaim": { - "claimName": "mariadb-claim0" - } - }, - { - "name": "mariadb-claim1", - "persistentVolumeClaim": { - "claimName": "mariadb-claim1" - } - } - ], "containers": [ { - "name": "mariadb", - "image": "centos/mariadb", - "ports": [ - { - "containerPort": 3306 - }, - { - "containerPort": 3307 - } - ], "env": [ { "name": "MYSQL_DATABASE", @@ -217,24 +209,47 @@ "value": "openshift" } ], + "image": "centos/mariadb", + "imagePullPolicy": "", + "name": "mariadb", + "ports": [ + { + "containerPort": 3306 + }, + { + "containerPort": 3307 + } + ], "resources": {}, "volumeMounts": [ { - "name": "mariadb-claim0", - "mountPath": "/var/lib/mysql" + "mountPath": "/var/lib/mysql", + "name": "mariadb-claim0" }, { - "name": "mariadb-claim1", - "mountPath": "/var/lib/mysql" + "mountPath": "/var/lib/mysql", + "name": "mariadb-claim1" } ] } ], - "restartPolicy": "Always" + "restartPolicy": "Always", + "serviceAccountName": "", + "volumes": [ + { + "name": "mariadb-claim0", + "persistentVolumeClaim": { + "claimName": "mariadb-claim0" + } + }, + { + "name": "mariadb-claim1", + "persistentVolumeClaim": { + "claimName": "mariadb-claim1" + } + } + ] } - }, - "strategy": { - "type": "Recreate" } }, "status": {} diff --git a/script/test/fixtures/network/output-k8s.json b/script/test/fixtures/network/output-k8s.json index a2919a5b..de92a32b 100644 --- a/script/test/fixtures/network/output-k8s.json +++ b/script/test/fixtures/network/output-k8s.json @@ -4,51 +4,59 @@ "metadata": {}, "items": [ { + "apiVersion": "apps/v1", "kind": "Deployment", - "apiVersion": "extensions/v1beta1", "metadata": { - "name": "appfoo", + "annotations": { + "kompose.cmd": "%CMD%", + "kompose.version": "%VERSION%" + }, "creationTimestamp": null, "labels": { "io.kompose.service": "appfoo" }, - "annotations": { - "kompose.cmd": "%CMD%", - "kompose.version": "%VERSION%" - } + "name": "appfoo" }, "spec": { "replicas": 1, + "selector": { + "matchLabels": { + "io.kompose.service": "appfoo" + } + }, + "strategy": {}, "template": { "metadata": { + "annotations": { + "kompose.cmd": "%CMD%", + "kompose.version": "%VERSION%" + }, "creationTimestamp": null, "labels": { "io.kompose.network/app-network": "true", "io.kompose.network/web-network": "true", "io.kompose.service": "appfoo" - }, - "annotations": { - "kompose.cmd": "%CMD%", - "kompose.version": "%VERSION%" } }, "spec": { "containers": [ { - "name": "appfoo", - "image": "foo:latest", "args": [ "sh", "-c", "echo Hello Foo" ], + "image": "foo:latest", + "imagePullPolicy": "", + "name": "appfoo", "resources": {} } ], - "restartPolicy": "Always" + "restartPolicy": "Always", + "serviceAccountName": "", + "volumes": null } - }, - "strategy": {} + } }, "status": {} }, diff --git a/script/test/fixtures/nginx-node-redis/output-k8s-template-v3.json b/script/test/fixtures/nginx-node-redis/output-k8s-template-v3.json index 48996f69..871cc04c 100644 --- a/script/test/fixtures/nginx-node-redis/output-k8s-template-v3.json +++ b/script/test/fixtures/nginx-node-redis/output-k8s-template-v3.json @@ -154,37 +154,44 @@ } }, { + "apiVersion": "apps/v1", "kind": "Deployment", - "apiVersion": "extensions/v1beta1", "metadata": { - "name": "nginx", + "annotations": { + "kompose.cmd": "%CMD%", + "kompose.version": "%VERSION%" + }, "creationTimestamp": null, "labels": { "io.kompose.service": "nginx" }, - "annotations": { - "kompose.cmd": "%CMD%", - "kompose.version": "%VERSION%" - } + "name": "nginx" }, "spec": { "replicas": 1, + "selector": { + "matchLabels": { + "io.kompose.service": "nginx" + } + }, + "strategy": {}, "template": { "metadata": { - "creationTimestamp": null, - "labels": { - "io.kompose.service": "nginx" - }, "annotations": { "kompose.cmd": "%CMD%", "kompose.version": "%VERSION%" + }, + "creationTimestamp": null, + "labels": { + "io.kompose.service": "nginx" } }, "spec": { "containers": [ { - "name": "nginx", "image": "nginx", + "imagePullPolicy": "", + "name": "nginx", "ports": [ { "containerPort": 80 @@ -193,45 +200,53 @@ "resources": {} } ], - "restartPolicy": "Always" + "restartPolicy": "Always", + "serviceAccountName": "", + "volumes": null } - }, - "strategy": {} + } }, "status": {} }, { + "apiVersion": "apps/v1", "kind": "Deployment", - "apiVersion": "extensions/v1beta1", "metadata": { - "name": "node1", + "annotations": { + "kompose.cmd": "%CMD%", + "kompose.version": "%VERSION%" + }, "creationTimestamp": null, "labels": { "io.kompose.service": "node1" }, - "annotations": { - "kompose.cmd": "%CMD%", - "kompose.version": "%VERSION%" - } + "name": "node1" }, "spec": { "replicas": 1, + "selector": { + "matchLabels": { + "io.kompose.service": "node1" + } + }, + "strategy": {}, "template": { "metadata": { - "creationTimestamp": null, - "labels": { - "io.kompose.service": "node1" - }, "annotations": { "kompose.cmd": "%CMD%", "kompose.version": "%VERSION%" + }, + "creationTimestamp": null, + "labels": { + "io.kompose.service": "node1" } }, "spec": { "containers": [ { - "name": "node1", "image": "node1", + "imagePullPolicy": "", + "name": "node1", "ports": [ { "containerPort": 8080 @@ -240,45 +255,53 @@ "resources": {} } ], - "restartPolicy": "Always" + "restartPolicy": "Always", + "serviceAccountName": "", + "volumes": null } - }, - "strategy": {} + } }, "status": {} }, { + "apiVersion": "apps/v1", "kind": "Deployment", - "apiVersion": "extensions/v1beta1", "metadata": { - "name": "node2", + "annotations": { + "kompose.cmd": "%CMD%", + "kompose.version": "%VERSION%" + }, "creationTimestamp": null, "labels": { "io.kompose.service": "node2" }, - "annotations": { - "kompose.cmd": "%CMD%", - "kompose.version": "%VERSION%" - } + "name": "node2" }, "spec": { "replicas": 1, + "selector": { + "matchLabels": { + "io.kompose.service": "node2" + } + }, + "strategy": {}, "template": { "metadata": { - "creationTimestamp": null, - "labels": { - "io.kompose.service": "node2" - }, "annotations": { "kompose.cmd": "%CMD%", "kompose.version": "%VERSION%" + }, + "creationTimestamp": null, + "labels": { + "io.kompose.service": "node2" } }, "spec": { "containers": [ { - "name": "node2", "image": "node2", + "imagePullPolicy": "", + "name": "node2", "ports": [ { "containerPort": 8080 @@ -287,45 +310,53 @@ "resources": {} } ], - "restartPolicy": "Always" + "restartPolicy": "Always", + "serviceAccountName": "", + "volumes": null } - }, - "strategy": {} + } }, "status": {} }, { + "apiVersion": "apps/v1", "kind": "Deployment", - "apiVersion": "extensions/v1beta1", "metadata": { - "name": "node3", + "annotations": { + "kompose.cmd": "%CMD%", + "kompose.version": "%VERSION%" + }, "creationTimestamp": null, "labels": { "io.kompose.service": "node3" }, - "annotations": { - "kompose.cmd": "%CMD%", - "kompose.version": "%VERSION%" - } + "name": "node3" }, "spec": { "replicas": 1, + "selector": { + "matchLabels": { + "io.kompose.service": "node3" + } + }, + "strategy": {}, "template": { "metadata": { - "creationTimestamp": null, - "labels": { - "io.kompose.service": "node3" - }, "annotations": { "kompose.cmd": "%CMD%", "kompose.version": "%VERSION%" + }, + "creationTimestamp": null, + "labels": { + "io.kompose.service": "node3" } }, "spec": { "containers": [ { - "name": "node3", "image": "node3", + "imagePullPolicy": "", + "name": "node3", "ports": [ { "containerPort": 8080 @@ -334,45 +365,53 @@ "resources": {} } ], - "restartPolicy": "Always" + "restartPolicy": "Always", + "serviceAccountName": "", + "volumes": null } - }, - "strategy": {} + } }, "status": {} }, { + "apiVersion": "apps/v1", "kind": "Deployment", - "apiVersion": "extensions/v1beta1", "metadata": { - "name": "redis", + "annotations": { + "kompose.cmd": "%CMD%", + "kompose.version": "%VERSION%" + }, "creationTimestamp": null, "labels": { "io.kompose.service": "redis" }, - "annotations": { - "kompose.cmd": "%CMD%", - "kompose.version": "%VERSION%" - } + "name": "redis" }, "spec": { "replicas": 1, + "selector": { + "matchLabels": { + "io.kompose.service": "redis" + } + }, + "strategy": {}, "template": { "metadata": { - "creationTimestamp": null, - "labels": { - "io.kompose.service": "redis" - }, "annotations": { "kompose.cmd": "%CMD%", "kompose.version": "%VERSION%" + }, + "creationTimestamp": null, + "labels": { + "io.kompose.service": "redis" } }, "spec": { "containers": [ { - "name": "redis", "image": "redis", + "imagePullPolicy": "", + "name": "redis", "ports": [ { "containerPort": 6379 @@ -381,10 +420,11 @@ "resources": {} } ], - "restartPolicy": "Always" + "restartPolicy": "Always", + "serviceAccountName": "", + "volumes": null } - }, - "strategy": {} + } }, "status": {} } diff --git a/script/test/fixtures/nginx-node-redis/output-k8s-template.json b/script/test/fixtures/nginx-node-redis/output-k8s-template.json index 48996f69..871cc04c 100644 --- a/script/test/fixtures/nginx-node-redis/output-k8s-template.json +++ b/script/test/fixtures/nginx-node-redis/output-k8s-template.json @@ -154,37 +154,44 @@ } }, { + "apiVersion": "apps/v1", "kind": "Deployment", - "apiVersion": "extensions/v1beta1", "metadata": { - "name": "nginx", + "annotations": { + "kompose.cmd": "%CMD%", + "kompose.version": "%VERSION%" + }, "creationTimestamp": null, "labels": { "io.kompose.service": "nginx" }, - "annotations": { - "kompose.cmd": "%CMD%", - "kompose.version": "%VERSION%" - } + "name": "nginx" }, "spec": { "replicas": 1, + "selector": { + "matchLabels": { + "io.kompose.service": "nginx" + } + }, + "strategy": {}, "template": { "metadata": { - "creationTimestamp": null, - "labels": { - "io.kompose.service": "nginx" - }, "annotations": { "kompose.cmd": "%CMD%", "kompose.version": "%VERSION%" + }, + "creationTimestamp": null, + "labels": { + "io.kompose.service": "nginx" } }, "spec": { "containers": [ { - "name": "nginx", "image": "nginx", + "imagePullPolicy": "", + "name": "nginx", "ports": [ { "containerPort": 80 @@ -193,45 +200,53 @@ "resources": {} } ], - "restartPolicy": "Always" + "restartPolicy": "Always", + "serviceAccountName": "", + "volumes": null } - }, - "strategy": {} + } }, "status": {} }, { + "apiVersion": "apps/v1", "kind": "Deployment", - "apiVersion": "extensions/v1beta1", "metadata": { - "name": "node1", + "annotations": { + "kompose.cmd": "%CMD%", + "kompose.version": "%VERSION%" + }, "creationTimestamp": null, "labels": { "io.kompose.service": "node1" }, - "annotations": { - "kompose.cmd": "%CMD%", - "kompose.version": "%VERSION%" - } + "name": "node1" }, "spec": { "replicas": 1, + "selector": { + "matchLabels": { + "io.kompose.service": "node1" + } + }, + "strategy": {}, "template": { "metadata": { - "creationTimestamp": null, - "labels": { - "io.kompose.service": "node1" - }, "annotations": { "kompose.cmd": "%CMD%", "kompose.version": "%VERSION%" + }, + "creationTimestamp": null, + "labels": { + "io.kompose.service": "node1" } }, "spec": { "containers": [ { - "name": "node1", "image": "node1", + "imagePullPolicy": "", + "name": "node1", "ports": [ { "containerPort": 8080 @@ -240,45 +255,53 @@ "resources": {} } ], - "restartPolicy": "Always" + "restartPolicy": "Always", + "serviceAccountName": "", + "volumes": null } - }, - "strategy": {} + } }, "status": {} }, { + "apiVersion": "apps/v1", "kind": "Deployment", - "apiVersion": "extensions/v1beta1", "metadata": { - "name": "node2", + "annotations": { + "kompose.cmd": "%CMD%", + "kompose.version": "%VERSION%" + }, "creationTimestamp": null, "labels": { "io.kompose.service": "node2" }, - "annotations": { - "kompose.cmd": "%CMD%", - "kompose.version": "%VERSION%" - } + "name": "node2" }, "spec": { "replicas": 1, + "selector": { + "matchLabels": { + "io.kompose.service": "node2" + } + }, + "strategy": {}, "template": { "metadata": { - "creationTimestamp": null, - "labels": { - "io.kompose.service": "node2" - }, "annotations": { "kompose.cmd": "%CMD%", "kompose.version": "%VERSION%" + }, + "creationTimestamp": null, + "labels": { + "io.kompose.service": "node2" } }, "spec": { "containers": [ { - "name": "node2", "image": "node2", + "imagePullPolicy": "", + "name": "node2", "ports": [ { "containerPort": 8080 @@ -287,45 +310,53 @@ "resources": {} } ], - "restartPolicy": "Always" + "restartPolicy": "Always", + "serviceAccountName": "", + "volumes": null } - }, - "strategy": {} + } }, "status": {} }, { + "apiVersion": "apps/v1", "kind": "Deployment", - "apiVersion": "extensions/v1beta1", "metadata": { - "name": "node3", + "annotations": { + "kompose.cmd": "%CMD%", + "kompose.version": "%VERSION%" + }, "creationTimestamp": null, "labels": { "io.kompose.service": "node3" }, - "annotations": { - "kompose.cmd": "%CMD%", - "kompose.version": "%VERSION%" - } + "name": "node3" }, "spec": { "replicas": 1, + "selector": { + "matchLabels": { + "io.kompose.service": "node3" + } + }, + "strategy": {}, "template": { "metadata": { - "creationTimestamp": null, - "labels": { - "io.kompose.service": "node3" - }, "annotations": { "kompose.cmd": "%CMD%", "kompose.version": "%VERSION%" + }, + "creationTimestamp": null, + "labels": { + "io.kompose.service": "node3" } }, "spec": { "containers": [ { - "name": "node3", "image": "node3", + "imagePullPolicy": "", + "name": "node3", "ports": [ { "containerPort": 8080 @@ -334,45 +365,53 @@ "resources": {} } ], - "restartPolicy": "Always" + "restartPolicy": "Always", + "serviceAccountName": "", + "volumes": null } - }, - "strategy": {} + } }, "status": {} }, { + "apiVersion": "apps/v1", "kind": "Deployment", - "apiVersion": "extensions/v1beta1", "metadata": { - "name": "redis", + "annotations": { + "kompose.cmd": "%CMD%", + "kompose.version": "%VERSION%" + }, "creationTimestamp": null, "labels": { "io.kompose.service": "redis" }, - "annotations": { - "kompose.cmd": "%CMD%", - "kompose.version": "%VERSION%" - } + "name": "redis" }, "spec": { "replicas": 1, + "selector": { + "matchLabels": { + "io.kompose.service": "redis" + } + }, + "strategy": {}, "template": { "metadata": { - "creationTimestamp": null, - "labels": { - "io.kompose.service": "redis" - }, "annotations": { "kompose.cmd": "%CMD%", "kompose.version": "%VERSION%" + }, + "creationTimestamp": null, + "labels": { + "io.kompose.service": "redis" } }, "spec": { "containers": [ { - "name": "redis", "image": "redis", + "imagePullPolicy": "", + "name": "redis", "ports": [ { "containerPort": 6379 @@ -381,10 +420,11 @@ "resources": {} } ], - "restartPolicy": "Always" + "restartPolicy": "Always", + "serviceAccountName": "", + "volumes": null } - }, - "strategy": {} + } }, "status": {} } diff --git a/script/test/fixtures/placement/output-k8s-array-template.json b/script/test/fixtures/placement/output-k8s-array-template.json index 98b49092..53cff666 100644 --- a/script/test/fixtures/placement/output-k8s-array-template.json +++ b/script/test/fixtures/placement/output-k8s-array-template.json @@ -4,47 +4,55 @@ "metadata": {}, "items": [ { + "apiVersion": "apps/v1", "kind": "Deployment", - "apiVersion": "extensions/v1beta1", "metadata": { - "name": "db", + "annotations": { + "kompose.cmd": "%CMD%", + "kompose.version": "%VERSION%" + }, "creationTimestamp": null, "labels": { "io.kompose.service": "db" }, - "annotations": { - "kompose.cmd": "%CMD%", - "kompose.version": "%VERSION%" - } + "name": "db" }, "spec": { "replicas": 1, + "selector": { + "matchLabels": { + "io.kompose.service": "db" + } + }, + "strategy": {}, "template": { "metadata": { - "creationTimestamp": null, - "labels": { - "io.kompose.service": "db" - }, "annotations": { "kompose.cmd": "%CMD%", "kompose.version": "%VERSION%" + }, + "creationTimestamp": null, + "labels": { + "io.kompose.service": "db" } }, "spec": { "containers": [ { - "name": "db", "image": "postgres", + "imagePullPolicy": "", + "name": "db", "resources": {} } ], - "restartPolicy": "Always", "nodeSelector": { "kubernetes.io/hostname": "machine" - } + }, + "restartPolicy": "Always", + "serviceAccountName": "", + "volumes": null } - }, - "strategy": {} + } }, "status": {} } diff --git a/script/test/fixtures/placement/output-k8s-template.json b/script/test/fixtures/placement/output-k8s-template.json index 77454a9d..04cb369f 100644 --- a/script/test/fixtures/placement/output-k8s-template.json +++ b/script/test/fixtures/placement/output-k8s-template.json @@ -4,48 +4,56 @@ "metadata": {}, "items": [ { + "apiVersion": "apps/v1", "kind": "Deployment", - "apiVersion": "extensions/v1beta1", "metadata": { - "name": "db", + "annotations": { + "kompose.cmd": "%CMD%", + "kompose.version": "%VERSION%" + }, "creationTimestamp": null, "labels": { "io.kompose.service": "db" }, - "annotations": { - "kompose.cmd": "%CMD%", - "kompose.version": "%VERSION%" - } + "name": "db" }, "spec": { "replicas": 1, + "selector": { + "matchLabels": { + "io.kompose.service": "db" + } + }, + "strategy": {}, "template": { "metadata": { - "creationTimestamp": null, - "labels": { - "io.kompose.service": "db" - }, "annotations": { "kompose.cmd": "%CMD%", "kompose.version": "%VERSION%" + }, + "creationTimestamp": null, + "labels": { + "io.kompose.service": "db" } }, "spec": { "containers": [ { - "name": "db", "image": "postgres", + "imagePullPolicy": "", + "name": "db", "resources": {} } ], - "restartPolicy": "Always", "nodeSelector": { "beta.kubernetes.io/os": "ubuntu 14.04", "kubernetes.io/hostname": "machine" - } + }, + "restartPolicy": "Always", + "serviceAccountName": "", + "volumes": null } - }, - "strategy": {} + } }, "status": {} } diff --git a/script/test/fixtures/ports-with-ip/output-k8s-template.json b/script/test/fixtures/ports-with-ip/output-k8s-template.json index 4b3a43f6..08bc4140 100644 --- a/script/test/fixtures/ports-with-ip/output-k8s-template.json +++ b/script/test/fixtures/ports-with-ip/output-k8s-template.json @@ -70,37 +70,44 @@ } }, { + "apiVersion": "apps/v1", "kind": "Deployment", - "apiVersion": "extensions/v1beta1", "metadata": { - "name": "redis", + "annotations": { + "kompose.cmd": "%CMD%", + "kompose.version": "%VERSION%" + }, "creationTimestamp": null, "labels": { "io.kompose.service": "redis" }, - "annotations": { - "kompose.cmd": "%CMD%", - "kompose.version": "%VERSION%" - } + "name": "redis" }, "spec": { "replicas": 1, + "selector": { + "matchLabels": { + "io.kompose.service": "redis" + } + }, + "strategy": {}, "template": { "metadata": { - "creationTimestamp": null, - "labels": { - "io.kompose.service": "redis" - }, "annotations": { "kompose.cmd": "%CMD%", "kompose.version": "%VERSION%" + }, + "creationTimestamp": null, + "labels": { + "io.kompose.service": "redis" } }, "spec": { "containers": [ { - "name": "redis", "image": "redis:3.0", + "imagePullPolicy": "", + "name": "redis", "ports": [ { "containerPort": 6379 @@ -113,45 +120,53 @@ "resources": {} } ], - "restartPolicy": "Always" + "restartPolicy": "Always", + "serviceAccountName": "", + "volumes": null } - }, - "strategy": {} + } }, "status": {} }, { + "apiVersion": "apps/v1", "kind": "Deployment", - "apiVersion": "extensions/v1beta1", "metadata": { - "name": "web", + "annotations": { + "kompose.cmd": "%CMD%", + "kompose.version": "%VERSION%" + }, "creationTimestamp": null, "labels": { "io.kompose.service": "web" }, - "annotations": { - "kompose.cmd": "%CMD%", - "kompose.version": "%VERSION%" - } + "name": "web" }, "spec": { "replicas": 1, + "selector": { + "matchLabels": { + "io.kompose.service": "web" + } + }, + "strategy": {}, "template": { "metadata": { - "creationTimestamp": null, - "labels": { - "io.kompose.service": "web" - }, "annotations": { "kompose.cmd": "%CMD%", "kompose.version": "%VERSION%" + }, + "creationTimestamp": null, + "labels": { + "io.kompose.service": "web" } }, "spec": { "containers": [ { - "name": "web", "image": "tuna/docker-counter23", + "imagePullPolicy": "", + "name": "web", "ports": [ { "containerPort": 5000, @@ -161,10 +176,11 @@ "resources": {} } ], - "restartPolicy": "Always" + "restartPolicy": "Always", + "serviceAccountName": "", + "volumes": null } - }, - "strategy": {} + } }, "status": {} } diff --git a/script/test/fixtures/ports-with-ip/output-k8s.json b/script/test/fixtures/ports-with-ip/output-k8s.json index a044e235..3fe836c0 100644 --- a/script/test/fixtures/ports-with-ip/output-k8s.json +++ b/script/test/fixtures/ports-with-ip/output-k8s.json @@ -13,7 +13,7 @@ "io.kompose.service": "redis" }, "annotations": { - "kompose.cmd": "kompose -f /home/snarwade/go/src/github.com/kubernetes/kompose/script/test/fixtures/ports-with-ip/docker-compose.yml convert --stdout -j", + "kompose.cmd": "%CMD%", "kompose.version": "1.0.0 (HEAD)" } }, @@ -49,7 +49,7 @@ "io.kompose.service": "web" }, "annotations": { - "kompose.cmd": "kompose -f /home/snarwade/go/src/github.com/kubernetes/kompose/script/test/fixtures/ports-with-ip/docker-compose.yml convert --stdout -j", + "kompose.cmd": "%CMD%", "kompose.version": "1.0.0 (HEAD)" } }, @@ -71,7 +71,7 @@ }, { "kind": "Deployment", - "apiVersion": "extensions/v1beta1", + "apiVersion": "apps/v1", "metadata": { "name": "redis", "creationTimestamp": null, @@ -79,7 +79,7 @@ "io.kompose.service": "redis" }, "annotations": { - "kompose.cmd": "kompose -f /home/snarwade/go/src/github.com/kubernetes/kompose/script/test/fixtures/ports-with-ip/docker-compose.yml convert --stdout -j", + "kompose.cmd": "%CMD%", "kompose.version": "1.0.0 (HEAD)" } }, @@ -118,7 +118,7 @@ }, { "kind": "Deployment", - "apiVersion": "extensions/v1beta1", + "apiVersion": "apps/v1", "metadata": { "name": "web", "creationTimestamp": null, @@ -126,7 +126,7 @@ "io.kompose.service": "web" }, "annotations": { - "kompose.cmd": "kompose -f /home/snarwade/go/src/github.com/kubernetes/kompose/script/test/fixtures/ports-with-ip/docker-compose.yml convert --stdout -j", + "kompose.cmd": "%CMD%", "kompose.version": "1.0.0 (HEAD)" } }, diff --git a/script/test/fixtures/ports-with-proto/output-k8s-template.json b/script/test/fixtures/ports-with-proto/output-k8s-template.json index a66e277b..6821761c 100644 --- a/script/test/fixtures/ports-with-proto/output-k8s-template.json +++ b/script/test/fixtures/ports-with-proto/output-k8s-template.json @@ -70,37 +70,44 @@ } }, { + "apiVersion": "apps/v1", "kind": "Deployment", - "apiVersion": "extensions/v1beta1", "metadata": { - "name": "redis", + "annotations": { + "kompose.cmd": "%CMD%", + "kompose.version": "%VERSION%" + }, "creationTimestamp": null, "labels": { "io.kompose.service": "redis" }, - "annotations": { - "kompose.cmd": "%CMD%", - "kompose.version": "%VERSION%" - } + "name": "redis" }, "spec": { "replicas": 1, + "selector": { + "matchLabels": { + "io.kompose.service": "redis" + } + }, + "strategy": {}, "template": { "metadata": { - "creationTimestamp": null, - "labels": { - "io.kompose.service": "redis" - }, "annotations": { "kompose.cmd": "%CMD%", "kompose.version": "%VERSION%" + }, + "creationTimestamp": null, + "labels": { + "io.kompose.service": "redis" } }, "spec": { "containers": [ { - "name": "redis", "image": "redis:3.0", + "imagePullPolicy": "", + "name": "redis", "ports": [ { "containerPort": 6379 @@ -113,45 +120,53 @@ "resources": {} } ], - "restartPolicy": "Always" + "restartPolicy": "Always", + "serviceAccountName": "", + "volumes": null } - }, - "strategy": {} + } }, "status": {} }, { + "apiVersion": "apps/v1", "kind": "Deployment", - "apiVersion": "extensions/v1beta1", "metadata": { - "name": "web", + "annotations": { + "kompose.cmd": "%CMD%", + "kompose.version": "%VERSION%" + }, "creationTimestamp": null, "labels": { "io.kompose.service": "web" }, - "annotations": { - "kompose.cmd": "%CMD%", - "kompose.version": "%VERSION%" - } + "name": "web" }, "spec": { "replicas": 1, + "selector": { + "matchLabels": { + "io.kompose.service": "web" + } + }, + "strategy": {}, "template": { "metadata": { - "creationTimestamp": null, - "labels": { - "io.kompose.service": "web" - }, "annotations": { "kompose.cmd": "%CMD%", "kompose.version": "%VERSION%" + }, + "creationTimestamp": null, + "labels": { + "io.kompose.service": "web" } }, "spec": { "containers": [ { - "name": "web", "image": "tuna/docker-counter23", + "imagePullPolicy": "", + "name": "web", "ports": [ { "containerPort": 5000 @@ -160,10 +175,11 @@ "resources": {} } ], - "restartPolicy": "Always" + "restartPolicy": "Always", + "serviceAccountName": "", + "volumes": null } - }, - "strategy": {} + } }, "status": {} } diff --git a/script/test/fixtures/restart-options/output-k8s-restart-unless-stopped.json b/script/test/fixtures/restart-options/output-k8s-restart-unless-stopped.json index 69143d95..c4d34704 100644 --- a/script/test/fixtures/restart-options/output-k8s-restart-unless-stopped.json +++ b/script/test/fixtures/restart-options/output-k8s-restart-unless-stopped.json @@ -4,50 +4,58 @@ "metadata": {}, "items": [ { + "apiVersion": "apps/v1", "kind": "Deployment", - "apiVersion": "extensions/v1beta1", "metadata": { - "name": "foo", + "annotations": { + "kompose.cmd": "%CMD%", + "kompose.version": "%VERSION%" + }, "creationTimestamp": null, "labels": { "io.kompose.service": "foo" }, - "annotations": { - "kompose.cmd": "%CMD%", - "kompose.version": "%VERSION%" - } + "name": "foo" }, "spec": { "replicas": 1, + "selector": { + "matchLabels": { + "io.kompose.service": "foo" + } + }, + "strategy": {}, "template": { "metadata": { - "creationTimestamp": null, - "labels": { - "io.kompose.service": "foo" - }, "annotations": { "kompose.cmd": "%CMD%", "kompose.version": "%VERSION%" + }, + "creationTimestamp": null, + "labels": { + "io.kompose.service": "foo" } }, "spec": { "containers": [ { - "name": "foo", - "image": "foobar", "env": [ { "name": "GITHUB", "value": "surajssd" } ], + "image": "foobar", + "imagePullPolicy": "", + "name": "foo", "resources": {} } ], - "restartPolicy": "Always" + "restartPolicy": "Always", + "serviceAccountName": "", + "volumes": null } - }, - "strategy": {} + } }, "status": {} } diff --git a/script/test/fixtures/restart-options/output-os-restart-unless-stopped.json b/script/test/fixtures/restart-options/output-os-restart-unless-stopped.json index d9ba6798..f3278a03 100644 --- a/script/test/fixtures/restart-options/output-os-restart-unless-stopped.json +++ b/script/test/fixtures/restart-options/output-os-restart-unless-stopped.json @@ -100,4 +100,4 @@ } } ] -} \ No newline at end of file +} diff --git a/script/test/fixtures/same-port-different-proto/output-k8s-template.json b/script/test/fixtures/same-port-different-proto/output-k8s-template.json index c58d4ea0..e167377c 100644 --- a/script/test/fixtures/same-port-different-proto/output-k8s-template.json +++ b/script/test/fixtures/same-port-different-proto/output-k8s-template.json @@ -76,37 +76,44 @@ } }, { + "apiVersion": "apps/v1", "kind": "Deployment", - "apiVersion": "extensions/v1beta1", "metadata": { - "name": "redis", + "annotations": { + "kompose.cmd": "%CMD%", + "kompose.version": "%VERSION%" + }, "creationTimestamp": null, "labels": { "io.kompose.service": "redis" }, - "annotations": { - "kompose.cmd": "%CMD%", - "kompose.version": "%VERSION%" - } + "name": "redis" }, "spec": { "replicas": 1, + "selector": { + "matchLabels": { + "io.kompose.service": "redis" + } + }, + "strategy": {}, "template": { "metadata": { - "creationTimestamp": null, - "labels": { - "io.kompose.service": "redis" - }, "annotations": { "kompose.cmd": "%CMD%", "kompose.version": "%VERSION%" + }, + "creationTimestamp": null, + "labels": { + "io.kompose.service": "redis" } }, "spec": { "containers": [ { - "name": "redis", "image": "redis:3.0", + "imagePullPolicy": "", + "name": "redis", "ports": [ { "containerPort": 6379 @@ -123,45 +130,53 @@ "resources": {} } ], - "restartPolicy": "Always" + "restartPolicy": "Always", + "serviceAccountName": "", + "volumes": null } - }, - "strategy": {} + } }, "status": {} }, { + "apiVersion": "apps/v1", "kind": "Deployment", - "apiVersion": "extensions/v1beta1", "metadata": { - "name": "web", + "annotations": { + "kompose.cmd": "%CMD%", + "kompose.version": "%VERSION%" + }, "creationTimestamp": null, "labels": { "io.kompose.service": "web" }, - "annotations": { - "kompose.cmd": "%CMD%", - "kompose.version": "%VERSION%" - } + "name": "web" }, "spec": { "replicas": 1, + "selector": { + "matchLabels": { + "io.kompose.service": "web" + } + }, + "strategy": {}, "template": { "metadata": { - "creationTimestamp": null, - "labels": { - "io.kompose.service": "web" - }, "annotations": { "kompose.cmd": "%CMD%", "kompose.version": "%VERSION%" + }, + "creationTimestamp": null, + "labels": { + "io.kompose.service": "web" } }, "spec": { "containers": [ { - "name": "web", "image": "tuna/docker-counter23", + "imagePullPolicy": "", + "name": "web", "ports": [ { "containerPort": 5000 @@ -170,10 +185,11 @@ "resources": {} } ], - "restartPolicy": "Always" + "restartPolicy": "Always", + "serviceAccountName": "", + "volumes": null } - }, - "strategy": {} + } }, "status": {} } diff --git a/script/test/fixtures/secrets/output-long-k8s.json b/script/test/fixtures/secrets/output-long-k8s.json index ac66dc1b..20d34711 100644 --- a/script/test/fixtures/secrets/output-long-k8s.json +++ b/script/test/fixtures/secrets/output-long-k8s.json @@ -19,65 +19,72 @@ "type": "Opaque" }, { + "apiVersion": "apps/v1", "kind": "Deployment", - "apiVersion": "extensions/v1beta1", "metadata": { - "name": "redis", + "annotations": { + "kompose.cmd": "%CMD%", + "kompose.version": "%VERSION%" + }, "creationTimestamp": null, "labels": { "io.kompose.service": "redis" }, - "annotations": { - "kompose.cmd": "%CMD%", - "kompose.version": "%VERSION%" - } + "name": "redis" }, "spec": { "replicas": 1, + "selector": { + "matchLabels": { + "io.kompose.service": "redis" + } + }, + "strategy": {}, "template": { "metadata": { - "creationTimestamp": null, - "labels": { - "io.kompose.service": "redis" - }, "annotations": { "kompose.cmd": "%CMD%", "kompose.version": "%VERSION%" + }, + "creationTimestamp": null, + "labels": { + "io.kompose.service": "redis" } }, "spec": { + "containers": [ + { + "image": "redis:latest", + "imagePullPolicy": "", + "name": "redis", + "resources": {}, + "volumeMounts": [ + { + "mountPath": "/run/secrets/my_secret", + "name": "my_secret" + } + ] + } + ], + "restartPolicy": "Always", + "serviceAccountName": "", "volumes": [ { "name": "my_secret", "secret": { - "secretName": "my_secret", + "defaultMode": 288, "items": [ { "key": "my_secret", "path": "redis_secret" } ], - "defaultMode": 288 + "secretName": "my_secret" } } - ], - "containers": [ - { - "name": "redis", - "image": "redis:latest", - "resources": {}, - "volumeMounts": [ - { - "name": "my_secret", - "mountPath": "/run/secrets/my_secret" - } - ] - } - ], - "restartPolicy": "Always" + ] } - }, - "strategy": {} + } }, "status": {} } diff --git a/script/test/fixtures/secrets/output-short-k8s.json b/script/test/fixtures/secrets/output-short-k8s.json index a2870406..6d4f679f 100644 --- a/script/test/fixtures/secrets/output-short-k8s.json +++ b/script/test/fixtures/secrets/output-short-k8s.json @@ -19,80 +19,87 @@ "type": "Opaque" }, { + "apiVersion": "apps/v1", "kind": "Deployment", - "apiVersion": "extensions/v1beta1", "metadata": { - "name": "redis", + "annotations": { + "kompose.cmd": "%CMD%", + "kompose.version": "%VERSION%" + }, "creationTimestamp": null, "labels": { "io.kompose.service": "redis" }, - "annotations": { - "kompose.cmd": "%CMD%", - "kompose.version": "%VERSION%" - } + "name": "redis" }, "spec": { "replicas": 1, + "selector": { + "matchLabels": { + "io.kompose.service": "redis" + } + }, + "strategy": {}, "template": { "metadata": { - "creationTimestamp": null, - "labels": { - "io.kompose.service": "redis" - }, "annotations": { "kompose.cmd": "%CMD%", "kompose.version": "%VERSION%" + }, + "creationTimestamp": null, + "labels": { + "io.kompose.service": "redis" } }, "spec": { + "containers": [ + { + "image": "redis:latest", + "imagePullPolicy": "", + "name": "redis", + "resources": {}, + "volumeMounts": [ + { + "mountPath": "/run/secrets/my_secret", + "name": "my_secret" + }, + { + "mountPath": "/run/secrets/my_other_secret", + "name": "my_other_secret" + } + ] + } + ], + "restartPolicy": "Always", + "serviceAccountName": "", "volumes": [ { "name": "my_secret", "secret": { - "secretName": "my_secret", "items": [ { "key": "my_secret", "path": "my_secret" } - ] + ], + "secretName": "my_secret" } }, { "name": "my_other_secret", "secret": { - "secretName": "my_other_secret", "items": [ { "key": "my_other_secret", "path": "my_other_secret" } - ] + ], + "secretName": "my_other_secret" } } - ], - "containers": [ - { - "name": "redis", - "image": "redis:latest", - "resources": {}, - "volumeMounts": [ - { - "name": "my_secret", - "mountPath": "/run/secrets/my_secret" - }, - { - "name": "my_other_secret", - "mountPath": "/run/secrets/my_other_secret" - } - ] - } - ], - "restartPolicy": "Always" + ] } - }, - "strategy": {} + } }, "status": {} } diff --git a/script/test/fixtures/service-name-change/output-k8s-template.json b/script/test/fixtures/service-name-change/output-k8s-template.json index 941666eb..84c7a73b 100644 --- a/script/test/fixtures/service-name-change/output-k8s-template.json +++ b/script/test/fixtures/service-name-change/output-k8s-template.json @@ -71,47 +71,45 @@ } }, { + "apiVersion": "apps/v1", "kind": "Deployment", - "apiVersion": "extensions/v1beta1", "metadata": { - "name": "mariadb", - "creationTimestamp": null, - "labels": { - "io.kompose.service": "mariadb" - }, "annotations": { "kompose.cmd": "%CMD%", "kompose.service.type": "headless", "kompose.version": "%VERSION%" - } + }, + "creationTimestamp": null, + "labels": { + "io.kompose.service": "mariadb" + }, + "name": "mariadb" }, "spec": { "replicas": 1, + "selector": { + "matchLabels": { + "io.kompose.service": "mariadb" + } + }, + "strategy": { + "type": "Recreate" + }, "template": { "metadata": { - "creationTimestamp": null, - "labels": { - "io.kompose.service": "mariadb" - }, "annotations": { "kompose.cmd": "%CMD%", "kompose.service.type": "headless", "kompose.version": "%VERSION%" + }, + "creationTimestamp": null, + "labels": { + "io.kompose.service": "mariadb" } }, "spec": { - "volumes": [ - { - "name": "servicenamechange-mariadb-data", - "persistentVolumeClaim": { - "claimName": "servicenamechange-mariadb-data" - } - } - ], "containers": [ { - "name": "mariadb", - "image": "bitnami/mariadb:latest", "env": [ { "name": "ALLOW_EMPTY_PASSWORD", @@ -126,20 +124,29 @@ "value": "bn_wordpress" } ], + "image": "bitnami/mariadb:latest", + "imagePullPolicy": "", + "name": "mariadb", "resources": {}, "volumeMounts": [ { - "name": "servicenamechange-mariadb-data", - "mountPath": "/bitnami/mariadb" + "mountPath": "/bitnami/mariadb", + "name": "servicenamechange-mariadb-data" } ] } ], - "restartPolicy": "Always" + "restartPolicy": "Always", + "serviceAccountName": "", + "volumes": [ + { + "name": "servicenamechange-mariadb-data", + "persistentVolumeClaim": { + "claimName": "servicenamechange-mariadb-data" + } + } + ] } - }, - "strategy": { - "type": "Recreate" } }, "status": {} @@ -167,65 +174,43 @@ "status": {} }, { + "apiVersion": "apps/v1", "kind": "Deployment", - "apiVersion": "extensions/v1beta1", "metadata": { - "name": "wordpress", + "annotations": { + "kompose.cmd": "%CMD%", + "kompose.version": "%VERSION%" + }, "creationTimestamp": null, "labels": { "io.kompose.service": "wordpress" }, - "annotations": { - "kompose.cmd": "%CMD%", - "kompose.version": "%VERSION%" - } + "name": "wordpress" }, "spec": { "replicas": 1, + "selector": { + "matchLabels": { + "io.kompose.service": "wordpress" + } + }, + "strategy": { + "type": "Recreate" + }, "template": { "metadata": { - "creationTimestamp": null, - "labels": { - "io.kompose.service": "wordpress" - }, "annotations": { "kompose.cmd": "%CMD%", "kompose.version": "%VERSION%" + }, + "creationTimestamp": null, + "labels": { + "io.kompose.service": "wordpress" } }, "spec": { - "volumes": [ - { - "name": "servicenamechange-wordpress-data", - "persistentVolumeClaim": { - "claimName": "servicenamechange-wordpress-data" - } - }, - { - "name": "servicenamechange-apache-data", - "persistentVolumeClaim": { - "claimName": "servicenamechange-apache-data" - } - }, - { - "name": "servicenamechange-php-data", - "persistentVolumeClaim": { - "claimName": "servicenamechange-php-data" - } - } - ], "containers": [ { - "name": "wordpress", - "image": "bitnami/wordpress:latest", - "ports": [ - { - "containerPort": 80 - }, - { - "containerPort": 443 - } - ], "env": [ { "name": "ALLOW_EMPTY_PASSWORD", @@ -248,28 +233,57 @@ "value": "bn_wordpress" } ], + "image": "bitnami/wordpress:latest", + "imagePullPolicy": "", + "name": "wordpress", + "ports": [ + { + "containerPort": 80 + }, + { + "containerPort": 443 + } + ], "resources": {}, "volumeMounts": [ { - "name": "servicenamechange-wordpress-data", - "mountPath": "/bitnami/wordpress" + "mountPath": "/bitnami/wordpress", + "name": "servicenamechange-wordpress-data" }, { - "name": "servicenamechange-apache-data", - "mountPath": "/bitnami/apache" + "mountPath": "/bitnami/apache", + "name": "servicenamechange-apache-data" }, { - "name": "servicenamechange-php-data", - "mountPath": "/bitnami/php" + "mountPath": "/bitnami/php", + "name": "servicenamechange-php-data" } ] } ], - "restartPolicy": "Always" + "restartPolicy": "Always", + "serviceAccountName": "", + "volumes": [ + { + "name": "servicenamechange-wordpress-data", + "persistentVolumeClaim": { + "claimName": "servicenamechange-wordpress-data" + } + }, + { + "name": "servicenamechange-apache-data", + "persistentVolumeClaim": { + "claimName": "servicenamechange-apache-data" + } + }, + { + "name": "servicenamechange-php-data", + "persistentVolumeClaim": { + "claimName": "servicenamechange-php-data" + } + } + ] } - }, - "strategy": { - "type": "Recreate" } }, "status": {} diff --git a/script/test/fixtures/stdin-true/output-k8s-template.json b/script/test/fixtures/stdin-true/output-k8s-template.json index 32d48a7f..d4b79ac9 100644 --- a/script/test/fixtures/stdin-true/output-k8s-template.json +++ b/script/test/fixtures/stdin-true/output-k8s-template.json @@ -34,37 +34,44 @@ } }, { + "apiVersion": "apps/v1", "kind": "Deployment", - "apiVersion": "extensions/v1beta1", "metadata": { - "name": "client", + "annotations": { + "kompose.cmd": "%CMD%", + "kompose.version": "%VERSION%" + }, "creationTimestamp": null, "labels": { "io.kompose.service": "client" }, - "annotations": { - "kompose.cmd": "%CMD%", - "kompose.version": "%VERSION%" - } + "name": "client" }, "spec": { "replicas": 1, + "selector": { + "matchLabels": { + "io.kompose.service": "client" + } + }, + "strategy": {}, "template": { "metadata": { - "creationTimestamp": null, - "labels": { - "io.kompose.service": "client" - }, "annotations": { "kompose.cmd": "%CMD%", "kompose.version": "%VERSION%" + }, + "creationTimestamp": null, + "labels": { + "io.kompose.service": "client" } }, "spec": { "containers": [ { - "name": "client", "image": "registry.centos.org/centos/centos:7", + "imagePullPolicy": "", + "name": "client", "ports": [ { "containerPort": 1337 @@ -74,10 +81,11 @@ "stdin": true } ], - "restartPolicy": "Always" + "restartPolicy": "Always", + "serviceAccountName": "", + "volumes": null } - }, - "strategy": {} + } }, "status": {} } diff --git a/script/test/fixtures/stdin/output-k8s.json b/script/test/fixtures/stdin/output-k8s.json index 2f83a5dc..954df8f8 100644 --- a/script/test/fixtures/stdin/output-k8s.json +++ b/script/test/fixtures/stdin/output-k8s.json @@ -4,44 +4,52 @@ "metadata": {}, "items": [ { + "apiVersion": "apps/v1", "kind": "Deployment", - "apiVersion": "extensions/v1beta1", "metadata": { - "name": "backend", + "annotations": { + "kompose.cmd": "kompose convert --stdout -j -f -", + "kompose.version": "%VERSION%" + }, "creationTimestamp": null, "labels": { "io.kompose.service": "backend" }, - "annotations": { - "kompose.cmd": "%CMD%", - "kompose.version": "%VERSION%" - } + "name": "backend" }, "spec": { "replicas": 1, + "selector": { + "matchLabels": { + "io.kompose.service": "backend" + } + }, + "strategy": {}, "template": { "metadata": { + "annotations": { + "kompose.cmd": "kompose convert --stdout -j -f -", + "kompose.version": "%VERSION%" + }, "creationTimestamp": null, "labels": { "io.kompose.service": "backend" - }, - "annotations": { - "kompose.cmd": "%CMD%", - "kompose.version": "%VERSION%" } }, "spec": { "containers": [ { - "name": "backend", "image": "helloworld", + "imagePullPolicy": "", + "name": "backend", "resources": {} } ], - "restartPolicy": "Always" + "restartPolicy": "Always", + "serviceAccountName": "", + "volumes": null } - }, - "strategy": {} + } }, "status": {} } diff --git a/script/test/fixtures/stdin/output.json b/script/test/fixtures/stdin/output.json index 0fbe4cd8..0d477e9e 100644 --- a/script/test/fixtures/stdin/output.json +++ b/script/test/fixtures/stdin/output.json @@ -35,7 +35,7 @@ }, { "kind": "Deployment", - "apiVersion": "extensions/v1beta1", + "apiVersion": "apps/v1", "metadata": { "name": "redis", "creationTimestamp": null, diff --git a/script/test/fixtures/tty-true/output-k8s-template.json b/script/test/fixtures/tty-true/output-k8s-template.json index 1f84e4e6..d1ed09dd 100644 --- a/script/test/fixtures/tty-true/output-k8s-template.json +++ b/script/test/fixtures/tty-true/output-k8s-template.json @@ -34,37 +34,44 @@ } }, { + "apiVersion": "apps/v1", "kind": "Deployment", - "apiVersion": "extensions/v1beta1", "metadata": { - "name": "client", + "annotations": { + "kompose.cmd": "%CMD%", + "kompose.version": "%VERSION%" + }, "creationTimestamp": null, "labels": { "io.kompose.service": "client" }, - "annotations": { - "kompose.cmd": "%CMD%", - "kompose.version": "%VERSION%" - } + "name": "client" }, "spec": { "replicas": 1, + "selector": { + "matchLabels": { + "io.kompose.service": "client" + } + }, + "strategy": {}, "template": { "metadata": { - "creationTimestamp": null, - "labels": { - "io.kompose.service": "client" - }, "annotations": { "kompose.cmd": "%CMD%", "kompose.version": "%VERSION%" + }, + "creationTimestamp": null, + "labels": { + "io.kompose.service": "client" } }, "spec": { "containers": [ { - "name": "client", "image": "registry.centos.org/centos/centos:7", + "imagePullPolicy": "", + "name": "client", "ports": [ { "containerPort": 1337 @@ -74,10 +81,11 @@ "tty": true } ], - "restartPolicy": "Always" + "restartPolicy": "Always", + "serviceAccountName": "", + "volumes": null } - }, - "strategy": {} + } }, "status": {} } diff --git a/script/test/fixtures/v3/output-deploy-mode-k8s-template.json b/script/test/fixtures/v3/output-deploy-mode-k8s-template.json index 37fff9ea..e4b5817e 100644 --- a/script/test/fixtures/v3/output-deploy-mode-k8s-template.json +++ b/script/test/fixtures/v3/output-deploy-mode-k8s-template.json @@ -36,19 +36,19 @@ } }, { + "apiVersion": "apps/v1", "kind": "DaemonSet", - "apiVersion": "extensions/v1beta1", "metadata": { - "name": "foo", - "creationTimestamp": null, - "labels": { - "io.kompose.service": "foo" - }, "annotations": { "kompose.cmd": "%CMD%", "kompose.service.type": "headless", "kompose.version": "%VERSION%" - } + }, + "creationTimestamp": null, + "labels": { + "io.kompose.service": "foo" + }, + "name": "foo" }, "spec": { "template": { @@ -61,20 +61,23 @@ "spec": { "containers": [ { - "name": "foo", "image": "redis", + "imagePullPolicy": "", + "name": "foo", "resources": {} } ], - "restartPolicy": "Always" + "restartPolicy": "Always", + "serviceAccountName": "", + "volumes": null } } }, "status": { "currentNumberScheduled": 0, - "numberMisscheduled": 0, - "desiredNumberScheduled": 0 + "desiredNumberScheduled": 0, + "numberMisscheduled": 0 } } ] -} \ No newline at end of file +} diff --git a/script/test/fixtures/v3/output-deploy-mode-os-template.json b/script/test/fixtures/v3/output-deploy-mode-os-template.json index ee24990b..f8095ee2 100644 --- a/script/test/fixtures/v3/output-deploy-mode-os-template.json +++ b/script/test/fixtures/v3/output-deploy-mode-os-template.json @@ -36,19 +36,19 @@ } }, { + "apiVersion": "apps/v1", "kind": "DaemonSet", - "apiVersion": "extensions/v1beta1", "metadata": { - "name": "foo", - "creationTimestamp": null, - "labels": { - "io.kompose.service": "foo" - }, "annotations": { "kompose.cmd": "%CMD%", "kompose.service.type": "headless", "kompose.version": "%VERSION%" - } + }, + "creationTimestamp": null, + "labels": { + "io.kompose.service": "foo" + }, + "name": "foo" }, "spec": { "template": { @@ -61,19 +61,22 @@ "spec": { "containers": [ { - "name": "foo", "image": "redis", + "imagePullPolicy": "", + "name": "foo", "resources": {} } ], - "restartPolicy": "Always" + "restartPolicy": "Always", + "serviceAccountName": "", + "volumes": null } } }, "status": { "currentNumberScheduled": 0, - "numberMisscheduled": 0, - "desiredNumberScheduled": 0 + "desiredNumberScheduled": 0, + "numberMisscheduled": 0 } }, { @@ -168,4 +171,4 @@ } } ] -} \ No newline at end of file +} diff --git a/script/test/fixtures/v3/output-env-k8s.json b/script/test/fixtures/v3/output-env-k8s.json index 0c0e6e5b..b129b863 100644 --- a/script/test/fixtures/v3/output-env-k8s.json +++ b/script/test/fixtures/v3/output-env-k8s.json @@ -36,52 +36,60 @@ } }, { + "apiVersion": "apps/v1", "kind": "Deployment", - "apiVersion": "extensions/v1beta1", "metadata": { - "name": "foo", - "creationTimestamp": null, - "labels": { - "io.kompose.service": "foo" - }, "annotations": { "kompose.cmd": "%CMD%", "kompose.service.type": "headless", "kompose.version": "%VERSION%" - } + }, + "creationTimestamp": null, + "labels": { + "io.kompose.service": "foo" + }, + "name": "foo" }, "spec": { "replicas": 1, + "selector": { + "matchLabels": { + "io.kompose.service": "foo" + } + }, + "strategy": {}, "template": { "metadata": { - "creationTimestamp": null, - "labels": { - "io.kompose.service": "foo" - }, "annotations": { "kompose.cmd": "%CMD%", "kompose.service.type": "headless", "kompose.version": "%VERSION%" + }, + "creationTimestamp": null, + "labels": { + "io.kompose.service": "foo" } }, "spec": { "containers": [ { - "name": "foo", - "image": "foo/bar:latest", "env": [ { "name": "FOO", "value": "foo" } ], + "image": "foo/bar:latest", + "imagePullPolicy": "", + "name": "foo", "resources": {} } ], - "restartPolicy": "Always" + "restartPolicy": "Always", + "serviceAccountName": "", + "volumes": null } - }, - "strategy": {} + } }, "status": {} } diff --git a/script/test/fixtures/v3/output-env-subs.json b/script/test/fixtures/v3/output-env-subs.json index 45d77072..3c99b0b3 100644 --- a/script/test/fixtures/v3/output-env-subs.json +++ b/script/test/fixtures/v3/output-env-subs.json @@ -4,50 +4,57 @@ "metadata": {}, "items": [ { + "apiVersion": "apps/v1", "kind": "Deployment", - "apiVersion": "extensions/v1beta1", "metadata": { - "name": "foo", + "annotations": { + "kompose.cmd": "%CMD%", + "kompose.version": "%VERSION%" + }, "creationTimestamp": null, "labels": { "io.kompose.service": "foo" }, - "annotations": { - "kompose.cmd": "%CMD%", - "kompose.version": "%VERSION%" - } + "name": "foo" }, "spec": { "replicas": 1, + "selector": { + "matchLabels": { + "io.kompose.service": "foo" + } + }, + "strategy": {}, "template": { "metadata": { - "creationTimestamp": null, - "labels": { - "io.kompose.service": "foo" - }, "annotations": { "kompose.cmd": "%CMD%", "kompose.version": "%VERSION%" + }, + "creationTimestamp": null, + "labels": { + "io.kompose.service": "foo" } }, "spec": { "containers": [ { - "name": "foo", - "image": "foo/bar:latest", "env": [ { - "name": "FOO", - "value": "bar" + "name": "FOO" } ], + "image": "foo/bar:latest", + "imagePullPolicy": "", + "name": "foo", "resources": {} } ], - "restartPolicy": "Always" + "restartPolicy": "Always", + "serviceAccountName": "", + "volumes": null } - }, - "strategy": {} + } }, "status": {} } diff --git a/script/test/fixtures/v3/output-k8s-3.5.json b/script/test/fixtures/v3/output-k8s-3.5.json index 85e7ddcf..539ea623 100644 --- a/script/test/fixtures/v3/output-k8s-3.5.json +++ b/script/test/fixtures/v3/output-k8s-3.5.json @@ -34,38 +34,45 @@ } }, { + "apiVersion": "apps/v1", "kind": "Deployment", - "apiVersion": "extensions/v1beta1", "metadata": { - "name": "helloworld", + "annotations": { + "kompose.cmd": "%CMD%", + "kompose.version": "%VERSION%" + }, "creationTimestamp": null, "labels": { "io.kompose.service": "helloworld" }, - "annotations": { - "kompose.cmd": "%CMD%", - "kompose.version": "%VERSION%" - } + "name": "helloworld" }, "spec": { "replicas": 1, + "selector": { + "matchLabels": { + "io.kompose.service": "helloworld" + } + }, + "strategy": {}, "template": { "metadata": { - "creationTimestamp": null, - "labels": { - "io.kompose.network/helloworld-network": "true", - "io.kompose.service": "helloworld" - }, "annotations": { "kompose.cmd": "%CMD%", "kompose.version": "%VERSION%" + }, + "creationTimestamp": null, + "labels": { + "io.kompose.network/helloworld-network": "true", + "io.kompose.service": "helloworld" } }, "spec": { "containers": [ { - "name": "helloworld", "image": "tutum/hello-world", + "imagePullPolicy": "", + "name": "helloworld", "ports": [ { "containerPort": 80 @@ -74,10 +81,11 @@ "resources": {} } ], - "restartPolicy": "Always" + "restartPolicy": "Always", + "serviceAccountName": "", + "volumes": null } - }, - "strategy": {} + } }, "status": {} }, diff --git a/script/test/fixtures/v3/output-k8s-full-example.json b/script/test/fixtures/v3/output-k8s-full-example.json index a59d33f0..cb936ca6 100644 --- a/script/test/fixtures/v3/output-k8s-full-example.json +++ b/script/test/fixtures/v3/output-k8s-full-example.json @@ -507,34 +507,6 @@ }, "status": {} }, - { - "kind": "NetworkPolicy", - "apiVersion": "extensions/v1beta1", - "metadata": { - "name": "other-other-network", - "creationTimestamp": null - }, - "spec": { - "podSelector": { - "matchLabels": { - "io.kompose.network/other-other-network": "true" - } - }, - "ingress": [ - { - "from": [ - { - "podSelector": { - "matchLabels": { - "io.kompose.network/other-other-network": "true" - } - } - } - ] - } - ] - } - }, { "kind": "NetworkPolicy", "apiVersion": "extensions/v1beta1", @@ -590,6 +562,34 @@ } ] } + }, + { + "kind": "NetworkPolicy", + "apiVersion": "extensions/v1beta1", + "metadata": { + "name": "other-other-network", + "creationTimestamp": null + }, + "spec": { + "podSelector": { + "matchLabels": { + "io.kompose.network/other-other-network": "true" + } + }, + "ingress": [ + { + "from": [ + { + "podSelector": { + "matchLabels": { + "io.kompose.network/other-other-network": "true" + } + } + } + ] + } + ] + } } ] } diff --git a/script/test/fixtures/v3/output-k8s-template.json b/script/test/fixtures/v3/output-k8s-template.json index 914f28fd..4502c4e0 100644 --- a/script/test/fixtures/v3/output-k8s-template.json +++ b/script/test/fixtures/v3/output-k8s-template.json @@ -96,92 +96,107 @@ } }, { + "apiVersion": "apps/v1", "kind": "Deployment", - "apiVersion": "extensions/v1beta1", "metadata": { - "name": "frontend", - "creationTimestamp": null, - "labels": { - "io.kompose.service": "frontend" - }, "annotations": { "kompose.cmd": "%CMD%", "kompose.service.type": "LoadBalancer", "kompose.version": "%VERSION%" - } + }, + "creationTimestamp": null, + "labels": { + "io.kompose.service": "frontend" + }, + "name": "frontend" }, "spec": { "replicas": 1, + "selector": { + "matchLabels": { + "io.kompose.service": "frontend" + } + }, + "strategy": {}, "template": { "metadata": { - "creationTimestamp": null, - "labels": { - "io.kompose.service": "frontend" - }, "annotations": { "kompose.cmd": "%CMD%", "kompose.service.type": "LoadBalancer", "kompose.version": "%VERSION%" + }, + "creationTimestamp": null, + "labels": { + "io.kompose.service": "frontend" } }, "spec": { "containers": [ { - "name": "frontend", + "env": [ + { + "name": "GET_HOSTS_FROM", + "value": "dns" + } + ], "image": "gcr.io/google-samples/gb-frontend:v4", + "imagePullPolicy": "", + "name": "frontend", "ports": [ { "containerPort": 80 } ], - "env": [ - { - "name": "GET_HOSTS_FROM", - "value": "dns" - } - ], "resources": {} } ], - "restartPolicy": "Always" + "restartPolicy": "Always", + "serviceAccountName": "", + "volumes": null } - }, - "strategy": {} + } }, "status": {} }, { + "apiVersion": "apps/v1", "kind": "Deployment", - "apiVersion": "extensions/v1beta1", "metadata": { - "name": "redis-master", + "annotations": { + "kompose.cmd": "%CMD%", + "kompose.version": "%VERSION%" + }, "creationTimestamp": null, "labels": { "io.kompose.service": "redis-master" }, - "annotations": { - "kompose.cmd": "%CMD%", - "kompose.version": "%VERSION%" - } + "name": "redis-master" }, "spec": { "replicas": 1, + "selector": { + "matchLabels": { + "io.kompose.service": "redis-master" + } + }, + "strategy": {}, "template": { "metadata": { - "creationTimestamp": null, - "labels": { - "io.kompose.service": "redis-master" - }, "annotations": { "kompose.cmd": "%CMD%", "kompose.version": "%VERSION%" + }, + "creationTimestamp": null, + "labels": { + "io.kompose.service": "redis-master" } }, "spec": { "containers": [ { - "name": "redis-master", "image": "k8s.gcr.io/redis:e2e", + "imagePullPolicy": "", + "name": "redis-master", "ports": [ { "containerPort": 6379 @@ -190,63 +205,72 @@ "resources": {} } ], - "restartPolicy": "Always" + "restartPolicy": "Always", + "serviceAccountName": "", + "volumes": null } - }, - "strategy": {} + } }, "status": {} }, { + "apiVersion": "apps/v1", "kind": "Deployment", - "apiVersion": "extensions/v1beta1", "metadata": { - "name": "redis-slave", + "annotations": { + "kompose.cmd": "%CMD%", + "kompose.version": "%VERSION%" + }, "creationTimestamp": null, "labels": { "io.kompose.service": "redis-slave" }, - "annotations": { - "kompose.cmd": "%CMD%", - "kompose.version": "%VERSION%" - } + "name": "redis-slave" }, "spec": { "replicas": 1, + "selector": { + "matchLabels": { + "io.kompose.service": "redis-slave" + } + }, + "strategy": {}, "template": { "metadata": { - "creationTimestamp": null, - "labels": { - "io.kompose.service": "redis-slave" - }, "annotations": { "kompose.cmd": "%CMD%", "kompose.version": "%VERSION%" + }, + "creationTimestamp": null, + "labels": { + "io.kompose.service": "redis-slave" } }, "spec": { "containers": [ { - "name": "redis-slave", - "image": "gcr.io/google_samples/gb-redisslave:v1", - "ports": [ - { - "containerPort": 6379 - } - ], "env": [ { "name": "GET_HOSTS_FROM", "value": "dns" } ], + "image": "gcr.io/google_samples/gb-redisslave:v1", + "imagePullPolicy": "", + "name": "redis-slave", + "ports": [ + { + "containerPort": 6379 + } + ], "resources": {} } ], - "restartPolicy": "Always" + "restartPolicy": "Always", + "serviceAccountName": "", + "volumes": null } - }, - "strategy": {} + } }, "status": {} } diff --git a/script/test/fixtures/v3/output-memcpu-k8s.json b/script/test/fixtures/v3/output-memcpu-k8s.json index 8374e8ec..a7202860 100644 --- a/script/test/fixtures/v3/output-memcpu-k8s.json +++ b/script/test/fixtures/v3/output-memcpu-k8s.json @@ -36,39 +36,46 @@ } }, { + "apiVersion": "apps/v1", "kind": "Deployment", - "apiVersion": "extensions/v1beta1", "metadata": { - "name": "foo", - "creationTimestamp": null, - "labels": { - "io.kompose.service": "foo" - }, "annotations": { "kompose.cmd": "%CMD%", "kompose.service.type": "headless", "kompose.version": "%VERSION%" - } + }, + "creationTimestamp": null, + "labels": { + "io.kompose.service": "foo" + }, + "name": "foo" }, "spec": { "replicas": 1, + "selector": { + "matchLabels": { + "io.kompose.service": "foo" + } + }, + "strategy": {}, "template": { "metadata": { - "creationTimestamp": null, - "labels": { - "io.kompose.service": "foo" - }, "annotations": { "kompose.cmd": "%CMD%", "kompose.service.type": "headless", "kompose.version": "%VERSION%" + }, + "creationTimestamp": null, + "labels": { + "io.kompose.service": "foo" } }, "spec": { "containers": [ { - "name": "foo", "image": "redis", + "imagePullPolicy": "", + "name": "foo", "resources": { "limits": { "cpu": "10m", @@ -81,10 +88,11 @@ } } ], - "restartPolicy": "Always" + "restartPolicy": "Always", + "serviceAccountName": "", + "volumes": null } - }, - "strategy": {} + } }, "status": {} } diff --git a/script/test/fixtures/v3/output-memcpu-partial-k8s.json b/script/test/fixtures/v3/output-memcpu-partial-k8s.json index 0149de47..6cdec754 100644 --- a/script/test/fixtures/v3/output-memcpu-partial-k8s.json +++ b/script/test/fixtures/v3/output-memcpu-partial-k8s.json @@ -36,39 +36,46 @@ } }, { + "apiVersion": "apps/v1", "kind": "Deployment", - "apiVersion": "extensions/v1beta1", "metadata": { - "name": "foo", - "creationTimestamp": null, - "labels": { - "io.kompose.service": "foo" - }, "annotations": { "kompose.cmd": "%CMD%", "kompose.service.type": "headless", "kompose.version": "%VERSION%" - } + }, + "creationTimestamp": null, + "labels": { + "io.kompose.service": "foo" + }, + "name": "foo" }, "spec": { "replicas": 1, + "selector": { + "matchLabels": { + "io.kompose.service": "foo" + } + }, + "strategy": {}, "template": { "metadata": { - "creationTimestamp": null, - "labels": { - "io.kompose.service": "foo" - }, "annotations": { "kompose.cmd": "%CMD%", "kompose.service.type": "headless", "kompose.version": "%VERSION%" + }, + "creationTimestamp": null, + "labels": { + "io.kompose.service": "foo" } }, "spec": { "containers": [ { - "name": "foo", "image": "redis", + "imagePullPolicy": "", + "name": "foo", "resources": { "limits": { "memory": "52428800" @@ -79,10 +86,11 @@ } } ], - "restartPolicy": "Always" + "restartPolicy": "Always", + "serviceAccountName": "", + "volumes": null } - }, - "strategy": {} + } }, "status": {} } diff --git a/script/test/fixtures/v3/output-unset-env-k8s.json b/script/test/fixtures/v3/output-unset-env-k8s.json index 92c58719..944525d3 100644 --- a/script/test/fixtures/v3/output-unset-env-k8s.json +++ b/script/test/fixtures/v3/output-unset-env-k8s.json @@ -36,56 +36,64 @@ } }, { + "apiVersion": "apps/v1", "kind": "Deployment", - "apiVersion": "extensions/v1beta1", "metadata": { - "name": "foo", - "creationTimestamp": null, - "labels": { - "io.kompose.service": "foo" - }, "annotations": { "kompose.cmd": "%CMD%", "kompose.service.type": "headless", "kompose.version": "%VERSION%" - } + }, + "creationTimestamp": null, + "labels": { + "io.kompose.service": "foo" + }, + "name": "foo" }, "spec": { "replicas": 1, + "selector": { + "matchLabels": { + "io.kompose.service": "foo" + } + }, + "strategy": {}, "template": { "metadata": { - "creationTimestamp": null, - "labels": { - "io.kompose.service": "foo" - }, "annotations": { "kompose.cmd": "%CMD%", "kompose.service.type": "headless", "kompose.version": "%VERSION%" + }, + "creationTimestamp": null, + "labels": { + "io.kompose.service": "foo" } }, "spec": { "containers": [ { - "name": "foo", - "image": "foo/bar:latest", "env": [ - { - "name": "V3_HOST_ENV_TEST_SET_TO_BAR", - "value": "BAR" - }, { "name": "FOO", "value": "foo" + }, + { + "name": "V3_HOST_ENV_TEST_SET_TO_BAR", + "value": "BAR" } ], + "image": "foo/bar:latest", + "imagePullPolicy": "", + "name": "foo", "resources": {} } ], - "restartPolicy": "Always" + "restartPolicy": "Always", + "serviceAccountName": "", + "volumes": null } - }, - "strategy": {} + } }, "status": {} } diff --git a/script/test/fixtures/v3/output-volumes-k8s-template.json b/script/test/fixtures/v3/output-volumes-k8s-template.json index 21ea2e4f..7330ab16 100644 --- a/script/test/fixtures/v3/output-volumes-k8s-template.json +++ b/script/test/fixtures/v3/output-volumes-k8s-template.json @@ -36,35 +36,59 @@ } }, { + "apiVersion": "apps/v1", "kind": "Deployment", - "apiVersion": "extensions/v1beta1", "metadata": { - "name": "foobar", - "creationTimestamp": null, - "labels": { - "io.kompose.service": "foobar" - }, "annotations": { "kompose.cmd": "%CMD%", "kompose.service.type": "headless", "kompose.version": "%VERSION%" - } + }, + "creationTimestamp": null, + "labels": { + "io.kompose.service": "foobar" + }, + "name": "foobar" }, "spec": { "replicas": 1, + "selector": { + "matchLabels": { + "io.kompose.service": "foobar" + } + }, + "strategy": { + "type": "Recreate" + }, "template": { "metadata": { - "creationTimestamp": null, - "labels": { - "io.kompose.service": "foobar" - }, "annotations": { "kompose.cmd": "%CMD%", "kompose.service.type": "headless", "kompose.version": "%VERSION%" + }, + "creationTimestamp": null, + "labels": { + "io.kompose.service": "foobar" } }, "spec": { + "containers": [ + { + "image": "foo/bar:latest", + "imagePullPolicy": "", + "name": "foobar", + "resources": {}, + "volumeMounts": [ + { + "mountPath": "/tmp/foo/bar", + "name": "foobar-claim0" + } + ] + } + ], + "restartPolicy": "Always", + "serviceAccountName": "", "volumes": [ { "name": "foobar-claim0", @@ -72,25 +96,8 @@ "claimName": "foobar-claim0" } } - ], - "containers": [ - { - "name": "foobar", - "image": "foo/bar:latest", - "resources": {}, - "volumeMounts": [ - { - "name": "foobar-claim0", - "mountPath": "/tmp/foo/bar" - } - ] - } - ], - "restartPolicy": "Always" + ] } - }, - "strategy": { - "type": "Recreate" } }, "status": {} diff --git a/script/test/fixtures/volume-mounts/hostpath/output-k8s-template.json b/script/test/fixtures/volume-mounts/hostpath/output-k8s-template.json index ba1827e1..19522294 100644 --- a/script/test/fixtures/volume-mounts/hostpath/output-k8s-template.json +++ b/script/test/fixtures/volume-mounts/hostpath/output-k8s-template.json @@ -34,45 +34,46 @@ } }, { + "apiVersion": "apps/v1", "kind": "Deployment", - "apiVersion": "extensions/v1beta1", "metadata": { - "name": "db", + "annotations": { + "kompose.cmd": "%CMD%", + "kompose.version": "%VERSION%" + }, "creationTimestamp": null, "labels": { "io.kompose.service": "db" }, - "annotations": { - "kompose.cmd": "%CMD%", - "kompose.version": "%VERSION%" - } + "name": "db" }, "spec": { "replicas": 1, + "selector": { + "matchLabels": { + "io.kompose.service": "db" + } + }, + "strategy": { + "type": "Recreate" + }, "template": { "metadata": { - "creationTimestamp": null, - "labels": { - "io.kompose.service": "db" - }, "annotations": { "kompose.cmd": "%CMD%", "kompose.version": "%VERSION%" + }, + "creationTimestamp": null, + "labels": { + "io.kompose.service": "db" } }, "spec": { - "volumes": [ - { - "name": "db-hostpath0", - "hostPath": { - "path": "%HOSTPATH%" - } - } - ], "containers": [ { - "name": "db", "image": "postgres:10.1", + "imagePullPolicy": "", + "name": "db", "ports": [ { "containerPort": 5432 @@ -81,17 +82,23 @@ "resources": {}, "volumeMounts": [ { - "name": "db-hostpath0", - "mountPath": "/var/lib/postgresql/data" + "mountPath": "/var/lib/postgresql/data", + "name": "db-hostpath0" } ] } ], - "restartPolicy": "Always" + "restartPolicy": "Always", + "serviceAccountName": "", + "volumes": [ + { + "hostPath": { + "path": "%HOSTPATH%" + }, + "name": "db-hostpath0" + } + ] } - }, - "strategy": { - "type": "Recreate" } }, "status": {} diff --git a/script/test/fixtures/volume-mounts/named-volume/output-k8s-template.json b/script/test/fixtures/volume-mounts/named-volume/output-k8s-template.json index 573d2689..c2d000a6 100644 --- a/script/test/fixtures/volume-mounts/named-volume/output-k8s-template.json +++ b/script/test/fixtures/volume-mounts/named-volume/output-k8s-template.json @@ -35,47 +35,48 @@ } }, { + "apiVersion": "apps/v1", "kind": "Deployment", - "apiVersion": "extensions/v1beta1", "metadata": { - "name": "db", - "creationTimestamp": null, - "labels": { - "io.kompose.service": "db" - }, "annotations": { "kompose.cmd": "%CMD%", "kompose.version": "%VERSION%", "kompose.volume.size": "1Gi" - } + }, + "creationTimestamp": null, + "labels": { + "io.kompose.service": "db" + }, + "name": "db" }, "spec": { "replicas": 1, + "selector": { + "matchLabels": { + "io.kompose.service": "db" + } + }, + "strategy": { + "type": "Recreate" + }, "template": { "metadata": { - "creationTimestamp": null, - "labels": { - "io.kompose.service": "db" - }, "annotations": { "kompose.cmd": "%CMD%", "kompose.version": "%VERSION%", "kompose.volume.size": "1Gi" + }, + "creationTimestamp": null, + "labels": { + "io.kompose.service": "db" } }, "spec": { - "volumes": [ - { - "name": "db-data", - "persistentVolumeClaim": { - "claimName": "db-data" - } - } - ], "containers": [ { - "name": "db", "image": "postgres:10.1", + "imagePullPolicy": "", + "name": "db", "ports": [ { "containerPort": 5432 @@ -84,17 +85,23 @@ "resources": {}, "volumeMounts": [ { - "name": "db-data", - "mountPath": "/var/lib/postgresql/data" + "mountPath": "/var/lib/postgresql/data", + "name": "db-data" } ] } ], - "restartPolicy": "Always" + "restartPolicy": "Always", + "serviceAccountName": "", + "volumes": [ + { + "name": "db-data", + "persistentVolumeClaim": { + "claimName": "db-data" + } + } + ] } - }, - "strategy": { - "type": "Recreate" } }, "status": {} diff --git a/script/test/fixtures/volume-mounts/named-volume/output-k8s-v3.json b/script/test/fixtures/volume-mounts/named-volume/output-k8s-v3.json index a62d4754..e1e03dbf 100644 --- a/script/test/fixtures/volume-mounts/named-volume/output-k8s-v3.json +++ b/script/test/fixtures/volume-mounts/named-volume/output-k8s-v3.json @@ -35,35 +35,68 @@ } }, { + "apiVersion": "apps/v1", "kind": "Deployment", - "apiVersion": "extensions/v1beta1", "metadata": { - "name": "db", - "creationTimestamp": null, - "labels": { - "io.kompose.service": "db" - }, "annotations": { "kompose.cmd": "%CMD%", "kompose.version": "%VERSION%", "kompose.volume.size": "200Mi" - } + }, + "creationTimestamp": null, + "labels": { + "io.kompose.service": "db" + }, + "name": "db" }, "spec": { "replicas": 1, + "selector": { + "matchLabels": { + "io.kompose.service": "db" + } + }, + "strategy": { + "type": "Recreate" + }, "template": { "metadata": { - "creationTimestamp": null, - "labels": { - "io.kompose.service": "db" - }, "annotations": { "kompose.cmd": "%CMD%", "kompose.version": "%VERSION%", "kompose.volume.size": "200Mi" + }, + "creationTimestamp": null, + "labels": { + "io.kompose.service": "db" } }, "spec": { + "containers": [ + { + "image": "postgres:10.1", + "imagePullPolicy": "", + "name": "db", + "ports": [ + { + "containerPort": 5432 + } + ], + "resources": {}, + "volumeMounts": [ + { + "mountPath": "/var/lib/postgresql/data", + "name": "db-data" + }, + { + "mountPath": "/var/lib/postgresql/config", + "name": "db-config" + } + ] + } + ], + "restartPolicy": "Always", + "serviceAccountName": "", "volumes": [ { "name": "db-data", @@ -77,34 +110,8 @@ "claimName": "db-config" } } - ], - "containers": [ - { - "name": "db", - "image": "postgres:10.1", - "ports": [ - { - "containerPort": 5432 - } - ], - "resources": {}, - "volumeMounts": [ - { - "name": "db-data", - "mountPath": "/var/lib/postgresql/data" - }, - { - "name": "db-config", - "mountPath": "/var/lib/postgresql/config" - } - ] - } - ], - "restartPolicy": "Always" + ] } - }, - "strategy": { - "type": "Recreate" } }, "status": {} diff --git a/script/test/fixtures/volume-mounts/simple-vol-mounts/output-k8s-template.json b/script/test/fixtures/volume-mounts/simple-vol-mounts/output-k8s-template.json index 394c4463..d6992389 100644 --- a/script/test/fixtures/volume-mounts/simple-vol-mounts/output-k8s-template.json +++ b/script/test/fixtures/volume-mounts/simple-vol-mounts/output-k8s-template.json @@ -34,45 +34,46 @@ } }, { + "apiVersion": "apps/v1", "kind": "Deployment", - "apiVersion": "extensions/v1beta1", "metadata": { - "name": "httpd", + "annotations": { + "kompose.cmd": "%CMD%", + "kompose.version": "%VERSION%" + }, "creationTimestamp": null, "labels": { "io.kompose.service": "httpd" }, - "annotations": { - "kompose.cmd": "%CMD%", - "kompose.version": "%VERSION%" - } + "name": "httpd" }, "spec": { "replicas": 1, + "selector": { + "matchLabels": { + "io.kompose.service": "httpd" + } + }, + "strategy": { + "type": "Recreate" + }, "template": { "metadata": { - "creationTimestamp": null, - "labels": { - "io.kompose.service": "httpd" - }, "annotations": { "kompose.cmd": "%CMD%", "kompose.version": "%VERSION%" + }, + "creationTimestamp": null, + "labels": { + "io.kompose.service": "httpd" } }, "spec": { - "volumes": [ - { - "name": "httpd-claim0", - "persistentVolumeClaim": { - "claimName": "httpd-claim0" - } - } - ], "containers": [ { - "name": "httpd", "image": "docker.io/fedora/apache", + "imagePullPolicy": "", + "name": "httpd", "ports": [ { "containerPort": 80 @@ -81,17 +82,23 @@ "resources": {}, "volumeMounts": [ { - "name": "httpd-claim0", - "mountPath": "/var/www/html" + "mountPath": "/var/www/html", + "name": "httpd-claim0" } ] } ], - "restartPolicy": "Always" + "restartPolicy": "Always", + "serviceAccountName": "", + "volumes": [ + { + "name": "httpd-claim0", + "persistentVolumeClaim": { + "claimName": "httpd-claim0" + } + } + ] } - }, - "strategy": { - "type": "Recreate" } }, "status": {} diff --git a/script/test/fixtures/volume-mounts/tmpfs/output-k8s-template.json b/script/test/fixtures/volume-mounts/tmpfs/output-k8s-template.json index 97527902..14d2051c 100644 --- a/script/test/fixtures/volume-mounts/tmpfs/output-k8s-template.json +++ b/script/test/fixtures/volume-mounts/tmpfs/output-k8s-template.json @@ -34,45 +34,44 @@ } }, { + "apiVersion": "apps/v1", "kind": "Deployment", - "apiVersion": "extensions/v1beta1", "metadata": { - "name": "redis-master", + "annotations": { + "kompose.cmd": "%CMD%", + "kompose.version": "%VERSION%" + }, "creationTimestamp": null, "labels": { "io.kompose.service": "redis-master" }, - "annotations": { - "kompose.cmd": "%CMD%", - "kompose.version": "%VERSION%" - } + "name": "redis-master" }, "spec": { "replicas": 1, + "selector": { + "matchLabels": { + "io.kompose.service": "redis-master" + } + }, + "strategy": {}, "template": { "metadata": { - "creationTimestamp": null, - "labels": { - "io.kompose.service": "redis-master" - }, "annotations": { "kompose.cmd": "%CMD%", "kompose.version": "%VERSION%" + }, + "creationTimestamp": null, + "labels": { + "io.kompose.service": "redis-master" } }, "spec": { - "volumes": [ - { - "name": "redis-master-tmpfs0", - "emptyDir": { - "medium": "Memory" - } - } - ], "containers": [ { - "name": "redis-master", "image": "k8s.gcr.io/redis:e2e", + "imagePullPolicy": "", + "name": "redis-master", "ports": [ { "containerPort": 6379 @@ -81,16 +80,24 @@ "resources": {}, "volumeMounts": [ { - "name": "redis-master-tmpfs0", - "mountPath": "/tmp" + "mountPath": "/tmp", + "name": "redis-master-tmpfs0" } ] } ], - "restartPolicy": "Always" + "restartPolicy": "Always", + "serviceAccountName": "", + "volumes": [ + { + "emptyDir": { + "medium": "Memory" + }, + "name": "redis-master-tmpfs0" + } + ] } - }, - "strategy": {} + } }, "status": {} } diff --git a/script/test/fixtures/volume-mounts/volumes-from/output-k8s-case.json b/script/test/fixtures/volume-mounts/volumes-from/output-k8s-case.json index f8c78995..3e8d5d05 100644 --- a/script/test/fixtures/volume-mounts/volumes-from/output-k8s-case.json +++ b/script/test/fixtures/volume-mounts/volumes-from/output-k8s-case.json @@ -86,7 +86,7 @@ }, { "kind": "Deployment", - "apiVersion": "extensions/v1beta1", + "apiVersion": "apps/v1", "metadata": { "name": "bar", "creationTimestamp": null, @@ -192,7 +192,7 @@ }, { "kind": "Deployment", - "apiVersion": "extensions/v1beta1", + "apiVersion": "apps/v1", "metadata": { "name": "cat", "creationTimestamp": null, @@ -268,7 +268,7 @@ }, { "kind": "Deployment", - "apiVersion": "extensions/v1beta1", + "apiVersion": "apps/v1", "metadata": { "name": "foo", "creationTimestamp": null, diff --git a/script/test/fixtures/volume-mounts/volumes-from/output-k8s-template.json b/script/test/fixtures/volume-mounts/volumes-from/output-k8s-template.json index f576e25c..b03e286b 100644 --- a/script/test/fixtures/volume-mounts/volumes-from/output-k8s-template.json +++ b/script/test/fixtures/volume-mounts/volumes-from/output-k8s-template.json @@ -64,33 +64,66 @@ } }, { + "apiVersion": "apps/v1", "kind": "Deployment", - "apiVersion": "extensions/v1beta1", "metadata": { - "name": "nginx", + "annotations": { + "kompose.cmd": "%CMD%", + "kompose.version": "%VERSION%" + }, "creationTimestamp": null, "labels": { "io.kompose.service": "nginx" }, - "annotations": { - "kompose.cmd": "%CMD%", - "kompose.version": "%VERSION%" - } + "name": "nginx" }, "spec": { "replicas": 1, + "selector": { + "matchLabels": { + "io.kompose.service": "nginx" + } + }, + "strategy": { + "type": "Recreate" + }, "template": { "metadata": { - "creationTimestamp": null, - "labels": { - "io.kompose.service": "nginx" - }, "annotations": { "kompose.cmd": "%CMD%", "kompose.version": "%VERSION%" + }, + "creationTimestamp": null, + "labels": { + "io.kompose.service": "nginx" } }, "spec": { + "containers": [ + { + "image": "nginx", + "imagePullPolicy": "", + "name": "nginx", + "ports": [ + { + "containerPort": 80 + } + ], + "resources": {}, + "volumeMounts": [ + { + "mountPath": "/www/public", + "name": "nginx-claim0" + }, + { + "mountPath": "/src/app", + "name": "web-claim0" + } + ] + } + ], + "restartPolicy": "Always", + "serviceAccountName": "", "volumes": [ { "name": "nginx-claim0", @@ -104,34 +137,8 @@ "claimName": "web-claim0" } } - ], - "containers": [ - { - "name": "nginx", - "image": "nginx", - "ports": [ - { - "containerPort": 80 - } - ], - "resources": {}, - "volumeMounts": [ - { - "name": "nginx-claim0", - "mountPath": "/www/public" - }, - { - "name": "web-claim0", - "mountPath": "/src/app" - } - ] - } - ], - "restartPolicy": "Always" + ] } - }, - "strategy": { - "type": "Recreate" } }, "status": {} @@ -159,50 +166,51 @@ "status": {} }, { + "apiVersion": "apps/v1", "kind": "Deployment", - "apiVersion": "extensions/v1beta1", "metadata": { - "name": "web", + "annotations": { + "kompose.cmd": "%CMD%", + "kompose.version": "%VERSION%" + }, "creationTimestamp": null, "labels": { "io.kompose.service": "web" }, - "annotations": { - "kompose.cmd": "%CMD%", - "kompose.version": "%VERSION%" - } + "name": "web" }, "spec": { "replicas": 1, + "selector": { + "matchLabels": { + "io.kompose.service": "web" + } + }, + "strategy": { + "type": "Recreate" + }, "template": { "metadata": { - "creationTimestamp": null, - "labels": { - "io.kompose.service": "web" - }, "annotations": { "kompose.cmd": "%CMD%", "kompose.version": "%VERSION%" + }, + "creationTimestamp": null, + "labels": { + "io.kompose.service": "web" } }, "spec": { - "volumes": [ - { - "name": "web-claim0", - "persistentVolumeClaim": { - "claimName": "web-claim0" - } - } - ], "containers": [ { - "name": "web", - "image": "centos/httpd", "args": [ "nodemon", "-L", "app/bin/www" ], + "image": "centos/httpd", + "imagePullPolicy": "", + "name": "web", "ports": [ { "containerPort": 3000 @@ -211,17 +219,23 @@ "resources": {}, "volumeMounts": [ { - "name": "web-claim0", - "mountPath": "/src/app" + "mountPath": "/src/app", + "name": "web-claim0" } ] } ], - "restartPolicy": "Always" + "restartPolicy": "Always", + "serviceAccountName": "", + "volumes": [ + { + "name": "web-claim0", + "persistentVolumeClaim": { + "claimName": "web-claim0" + } + } + ] } - }, - "strategy": { - "type": "Recreate" } }, "status": {} diff --git a/script/test/fixtures/yaml-and-yml/output-k8s-template.json b/script/test/fixtures/yaml-and-yml/output-k8s-template.json index 95fa9a11..1411467d 100644 --- a/script/test/fixtures/yaml-and-yml/output-k8s-template.json +++ b/script/test/fixtures/yaml-and-yml/output-k8s-template.json @@ -64,37 +64,44 @@ } }, { + "apiVersion": "apps/v1", "kind": "Deployment", - "apiVersion": "extensions/v1beta1", "metadata": { - "name": "redis", + "annotations": { + "kompose.cmd": "kompose convert --stdout -j", + "kompose.version": "%VERSION%" + }, "creationTimestamp": null, "labels": { "io.kompose.service": "redis" }, - "annotations": { - "kompose.cmd": "kompose convert --stdout -j", - "kompose.version": "%VERSION%" - } + "name": "redis" }, "spec": { "replicas": 1, + "selector": { + "matchLabels": { + "io.kompose.service": "redis" + } + }, + "strategy": {}, "template": { "metadata": { - "creationTimestamp": null, - "labels": { - "io.kompose.service": "redis" - }, "annotations": { "kompose.cmd": "kompose convert --stdout -j", "kompose.version": "%VERSION%" + }, + "creationTimestamp": null, + "labels": { + "io.kompose.service": "redis" } }, "spec": { "containers": [ { - "name": "redis", "image": "redis:3.0", + "imagePullPolicy": "", + "name": "redis", "ports": [ { "containerPort": 6379 @@ -103,45 +110,53 @@ "resources": {} } ], - "restartPolicy": "Always" + "restartPolicy": "Always", + "serviceAccountName": "", + "volumes": null } - }, - "strategy": {} + } }, "status": {} }, { + "apiVersion": "apps/v1", "kind": "Deployment", - "apiVersion": "extensions/v1beta1", "metadata": { - "name": "web", + "annotations": { + "kompose.cmd": "kompose convert --stdout -j", + "kompose.version": "%VERSION%" + }, "creationTimestamp": null, "labels": { "io.kompose.service": "web" }, - "annotations": { - "kompose.cmd": "kompose convert --stdout -j", - "kompose.version": "%VERSION%" - } + "name": "web" }, "spec": { "replicas": 1, + "selector": { + "matchLabels": { + "io.kompose.service": "web" + } + }, + "strategy": {}, "template": { "metadata": { - "creationTimestamp": null, - "labels": { - "io.kompose.service": "web" - }, "annotations": { "kompose.cmd": "kompose convert --stdout -j", "kompose.version": "%VERSION%" + }, + "creationTimestamp": null, + "labels": { + "io.kompose.service": "web" } }, "spec": { "containers": [ { - "name": "web", "image": "tuna/docker-counter23", + "imagePullPolicy": "", + "name": "web", "ports": [ { "containerPort": 5000 @@ -150,10 +165,11 @@ "resources": {} } ], - "restartPolicy": "Always" + "restartPolicy": "Always", + "serviceAccountName": "", + "volumes": null } - }, - "strategy": {} + } }, "status": {} } diff --git a/script/test/fixtures/yaml-and-yml/yml/output-k8s-template.json b/script/test/fixtures/yaml-and-yml/yml/output-k8s-template.json index 95fa9a11..1411467d 100644 --- a/script/test/fixtures/yaml-and-yml/yml/output-k8s-template.json +++ b/script/test/fixtures/yaml-and-yml/yml/output-k8s-template.json @@ -64,37 +64,44 @@ } }, { + "apiVersion": "apps/v1", "kind": "Deployment", - "apiVersion": "extensions/v1beta1", "metadata": { - "name": "redis", + "annotations": { + "kompose.cmd": "kompose convert --stdout -j", + "kompose.version": "%VERSION%" + }, "creationTimestamp": null, "labels": { "io.kompose.service": "redis" }, - "annotations": { - "kompose.cmd": "kompose convert --stdout -j", - "kompose.version": "%VERSION%" - } + "name": "redis" }, "spec": { "replicas": 1, + "selector": { + "matchLabels": { + "io.kompose.service": "redis" + } + }, + "strategy": {}, "template": { "metadata": { - "creationTimestamp": null, - "labels": { - "io.kompose.service": "redis" - }, "annotations": { "kompose.cmd": "kompose convert --stdout -j", "kompose.version": "%VERSION%" + }, + "creationTimestamp": null, + "labels": { + "io.kompose.service": "redis" } }, "spec": { "containers": [ { - "name": "redis", "image": "redis:3.0", + "imagePullPolicy": "", + "name": "redis", "ports": [ { "containerPort": 6379 @@ -103,45 +110,53 @@ "resources": {} } ], - "restartPolicy": "Always" + "restartPolicy": "Always", + "serviceAccountName": "", + "volumes": null } - }, - "strategy": {} + } }, "status": {} }, { + "apiVersion": "apps/v1", "kind": "Deployment", - "apiVersion": "extensions/v1beta1", "metadata": { - "name": "web", + "annotations": { + "kompose.cmd": "kompose convert --stdout -j", + "kompose.version": "%VERSION%" + }, "creationTimestamp": null, "labels": { "io.kompose.service": "web" }, - "annotations": { - "kompose.cmd": "kompose convert --stdout -j", - "kompose.version": "%VERSION%" - } + "name": "web" }, "spec": { "replicas": 1, + "selector": { + "matchLabels": { + "io.kompose.service": "web" + } + }, + "strategy": {}, "template": { "metadata": { - "creationTimestamp": null, - "labels": { - "io.kompose.service": "web" - }, "annotations": { "kompose.cmd": "kompose convert --stdout -j", "kompose.version": "%VERSION%" + }, + "creationTimestamp": null, + "labels": { + "io.kompose.service": "web" } }, "spec": { "containers": [ { - "name": "web", "image": "tuna/docker-counter23", + "imagePullPolicy": "", + "name": "web", "ports": [ { "containerPort": 5000 @@ -150,10 +165,11 @@ "resources": {} } ], - "restartPolicy": "Always" + "restartPolicy": "Always", + "serviceAccountName": "", + "volumes": null } - }, - "strategy": {} + } }, "status": {} }