Skip to content

Commit

Permalink
fix: remove some code nits
Browse files Browse the repository at this point in the history
Signed-off-by: AhmedGrati <[email protected]>
  • Loading branch information
TessaIO committed Jul 16, 2023
1 parent bb94d4e commit 608f876
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 8 deletions.
9 changes: 2 additions & 7 deletions pkg/transformer/kubernetes/kubernetes.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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,
}
Expand Down
1 change: 0 additions & 1 deletion pkg/transformer/openshift/openshift.go
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 2 additions & 0 deletions script/test/fixtures/read-only/output-k8s.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ metadata:
labels:
io.kompose.service: test
name: test
namespace: default
spec:
ports:
- name: "80"
Expand All @@ -24,6 +25,7 @@ metadata:
labels:
io.kompose.service: test
name: test
namespace: default
spec:
replicas: 1
selector:
Expand Down
3 changes: 3 additions & 0 deletions script/test/fixtures/read-only/output-os.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ metadata:
labels:
io.kompose.service: test
name: test
namespace: default
spec:
ports:
- name: "80"
Expand All @@ -24,6 +25,7 @@ metadata:
labels:
io.kompose.service: test
name: test
namespace: default
spec:
replicas: 1
selector:
Expand Down Expand Up @@ -75,6 +77,7 @@ metadata:
labels:
io.kompose.service: test
name: test
namespace: default
spec:
lookupPolicy:
local: false
Expand Down

0 comments on commit 608f876

Please sign in to comment.