You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by pc...@apache.org on 2022/01/07 13:48:29 UTC

[camel-k] 23/24: fix(trait): swap name and namespace

This is an automated email from the ASF dual-hosted git repository.

pcongiusti pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel-k.git

commit e0016b90522220d47b0dbb5bc3c851da89fe2fc7
Author: Pasquale Congiusti <pa...@gmail.com>
AuthorDate: Wed Jan 5 14:48:13 2022 +0100

    fix(trait): swap name and namespace
---
 pkg/trait/mount.go   | 2 +-
 pkg/trait/openapi.go | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/pkg/trait/mount.go b/pkg/trait/mount.go
index 00c6e69..38dcc26 100644
--- a/pkg/trait/mount.go
+++ b/pkg/trait/mount.go
@@ -172,7 +172,7 @@ func (t *mountTrait) attachResource(e *Environment, conf *utilResource.Config) {
 	if conf.StorageType() == utilResource.StorageTypeConfigmap {
 		// verify if it was autogenerated
 		cm, err := kubernetes.GetUnstructured(e.Ctx, e.Client, schema.GroupVersionKind{Group: "", Version: "v1", Kind: "ConfigMap"},
-			e.Integration.Namespace, conf.Name())
+			conf.Name(), e.Integration.Namespace)
 		if err == nil && cm != nil && cm.GetLabels()[kubernetes.ConfigMapAutogenLabel] == "true" {
 			refCm := kubernetes.NewConfigMap(e.Integration.Namespace, conf.Name(), "", "", "", nil)
 			e.Resources.Add(refCm)
diff --git a/pkg/trait/openapi.go b/pkg/trait/openapi.go
index 73af311..c94f6fa 100644
--- a/pkg/trait/openapi.go
+++ b/pkg/trait/openapi.go
@@ -139,7 +139,7 @@ func (t *openAPITrait) generateFromConfigmaps(e *Environment, tmpDir string) ([]
 	for _, configmap := range t.Configmaps {
 		// verify if it was autogenerated
 		cm, err := kubernetes.GetUnstructured(e.Ctx, e.Client, schema.GroupVersionKind{Group: "", Version: "v1", Kind: "ConfigMap"},
-			e.Integration.Namespace, configmap)
+			configmap, e.Integration.Namespace)
 		if err == nil && cm != nil && cm.GetLabels()[kubernetes.ConfigMapAutogenLabel] == "true" {
 			refCm := kubernetes.NewConfigMap(e.Integration.Namespace, configmap, "", "", "", nil)
 			e.Resources.Add(refCm)