diff --git a/pkg/transformer/kubernetes/kubernetes.go b/pkg/transformer/kubernetes/kubernetes.go index 43654d95f..6a404cfe6 100644 --- a/pkg/transformer/kubernetes/kubernetes.go +++ b/pkg/transformer/kubernetes/kubernetes.go @@ -220,10 +220,6 @@ func (k *Kubernetes) InitSvc(name string, service kobject.ServiceConfig) *api.Se // InitConfigMapForEnv initializes a ConfigMap object func (k *Kubernetes) InitConfigMapForEnv(name string, opt kobject.ConvertOptions, envFile string) *api.ConfigMap { - ns := "default" - if opt.Namespace != "" { - ns = opt.Namespace - } envs, err := GetEnvsFromFile(envFile, opt) if err != nil { log.Fatalf("Unable to retrieve env file: %s", err) @@ -240,9 +236,8 @@ func (k *Kubernetes) InitConfigMapForEnv(name string, opt kobject.ConvertOptions APIVersion: "v1", }, ObjectMeta: metav1.ObjectMeta{ - Name: envName, - Namespace: ns, - Labels: transformer.ConfigLabels(name + "-" + envName), + Name: envName, + Labels: transformer.ConfigLabels(name + "-" + envName), }, Data: envs, } diff --git a/pkg/transformer/openshift/openshift.go b/pkg/transformer/openshift/openshift.go index 02aec3036..8e77262eb 100644 --- a/pkg/transformer/openshift/openshift.go +++ b/pkg/transformer/openshift/openshift.go @@ -257,7 +257,6 @@ func (o *OpenShift) Transform(komposeObject kobject.KomposeObject, opt kobject.C for _, keyName := range noSupKeys { log.Warningf("OpenShift provider doesn't support %s key - ignoring", keyName) } - // this will hold all the converted data var allobjects []runtime.Object diff --git a/script/test/fixtures/read-only/output-k8s.yaml b/script/test/fixtures/read-only/output-k8s.yaml index d18582fde..7d7d3fbf5 100644 --- a/script/test/fixtures/read-only/output-k8s.yaml +++ b/script/test/fixtures/read-only/output-k8s.yaml @@ -6,6 +6,7 @@ metadata: labels: io.kompose.service: test name: test + namespace: default spec: ports: - name: "80" @@ -24,6 +25,7 @@ metadata: labels: io.kompose.service: test name: test + namespace: default spec: replicas: 1 selector: diff --git a/script/test/fixtures/read-only/output-os.yaml b/script/test/fixtures/read-only/output-os.yaml index 40cc310ed..876ce92ab 100644 --- a/script/test/fixtures/read-only/output-os.yaml +++ b/script/test/fixtures/read-only/output-os.yaml @@ -6,6 +6,7 @@ metadata: labels: io.kompose.service: test name: test + namespace: default spec: ports: - name: "80" @@ -24,6 +25,7 @@ metadata: labels: io.kompose.service: test name: test + namespace: default spec: replicas: 1 selector: @@ -75,6 +77,7 @@ metadata: labels: io.kompose.service: test name: test + namespace: default spec: lookupPolicy: local: false