This is an automated email from the ASF dual-hosted git repository. astefanutti pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/camel-k.git
commit 8222f28f3ba0fdee1bae087ead5d63e5f2c0b35b Author: John Poth <poth.j...@gmail.com> AuthorDate: Mon Sep 6 16:27:48 2021 +0200 Fix #2553: Support only one ServiceBinding for now --- pkg/trait/service_binding.go | 3 +-- pkg/trait/trait_types.go | 9 +++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/pkg/trait/service_binding.go b/pkg/trait/service_binding.go index 2d6e87c..c770e1f 100644 --- a/pkg/trait/service_binding.go +++ b/pkg/trait/service_binding.go @@ -77,8 +77,7 @@ func (t *serviceBindingTrait) Apply(e *Environment) error { e.Resources.Add(secret) e.ApplicationProperties["quarkus.kubernetes-service-binding.enabled"] = "true" e.ApplicationProperties["SERVICE_BINDING_ROOT"] = serviceBindingsMountPath - e.ServiceBindings = make(map[string]string) - e.ServiceBindings[e.Integration.Name] = secret.GetName() + e.ServiceBindingSecret = secret.GetName() } return nil } diff --git a/pkg/trait/trait_types.go b/pkg/trait/trait_types.go index 47df0b8..f3708c8 100644 --- a/pkg/trait/trait_types.go +++ b/pkg/trait/trait_types.go @@ -209,7 +209,7 @@ type Environment struct { EnvVars []corev1.EnvVar ApplicationProperties map[string]string Interceptors []string - ServiceBindings map[string]string + ServiceBindingSecret string } // ControllerStrategy is used to determine the kind of controller that needs to be created for the integration @@ -732,8 +732,9 @@ func (e *Environment) configureVolumesAndMounts(vols *[]corev1.Volume, mnts *[]c // Volumes :: Additional Secrets // // append Service Binding secrets - for sb, secret := range e.ServiceBindings { - refName := kubernetes.SanitizeLabel(sb) + if len(e.ServiceBindingSecret) > 0 { + secret := e.ServiceBindingSecret + refName := kubernetes.SanitizeLabel(secret) *vols = append(*vols, corev1.Volume{ Name: refName, @@ -746,7 +747,7 @@ func (e *Environment) configureVolumesAndMounts(vols *[]corev1.Volume, mnts *[]c *mnts = append(*mnts, corev1.VolumeMount{ Name: refName, - MountPath: path.Join(serviceBindingsMountPath, strings.ToLower(sb)), + MountPath: path.Join(serviceBindingsMountPath, strings.ToLower(secret)), }) }