From f1882dd19a6a1f1eb6acccd00151a00090f7b434 Mon Sep 17 00:00:00 2001 From: Pasquale Congiusti Date: Fri, 13 Oct 2023 12:03:43 +0200 Subject: [PATCH] chore(trait): keep kamelet default location To maintain backward compatibility --- pkg/trait/kamelets.go | 2 +- pkg/trait/trait_types.go | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/pkg/trait/kamelets.go b/pkg/trait/kamelets.go index aed2c8ff31..5f8d122f71 100644 --- a/pkg/trait/kamelets.go +++ b/pkg/trait/kamelets.go @@ -205,7 +205,7 @@ func (t *kameletsTrait) addKamelets(e *Environment) error { if e.ApplicationProperties == nil { e.ApplicationProperties = map[string]string{} } - e.ApplicationProperties[KameletLocationProperty] = fmt.Sprintf("file:%s", t.MountPoint) + e.ApplicationProperties[KameletLocationProperty] = fmt.Sprintf("file:%s,classpath:/kamelets", t.MountPoint) e.Resources.Add(&kameletsBundleConfigmap) // resort dependencies sort.Strings(e.Integration.Status.Dependencies) diff --git a/pkg/trait/trait_types.go b/pkg/trait/trait_types.go index 8543e138eb..6ae03139c3 100644 --- a/pkg/trait/trait_types.go +++ b/pkg/trait/trait_types.go @@ -518,6 +518,8 @@ func (e *Environment) configureVolumesAndMounts(vols *[]corev1.Volume, mnts *[]c } else if configMap.Labels[kubernetes.ConfigMapTypeLabel] == "kamelets-bundle" { // Kamelets bundle configmap kameletMountPoint := strings.ReplaceAll(e.ApplicationProperties[KameletLocationProperty], "file:", "") + // We need also to remove the default location provided + kameletMountPoint = strings.ReplaceAll(kameletMountPoint, ",classpath:/kamelets", "") refName := "kamelets-bundle" vol := getVolume(refName, "configmap", configMap.Name, "", "") mnt := getMount(refName, kameletMountPoint, "", true)