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

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

commit 8853ffe07dea0ea8a1322fc4e8ad2355b8c19e1a
Author: John Poth <poth.j...@gmail.com>
AuthorDate: Thu Mar 4 13:41:46 2021 +0100

    chore: name the ServiceBinding simply to the integration name
---
 pkg/trait/service_binding.go | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/pkg/trait/service_binding.go b/pkg/trait/service_binding.go
index a78143e..d8ebb3a 100644
--- a/pkg/trait/service_binding.go
+++ b/pkg/trait/service_binding.go
@@ -66,7 +66,6 @@ func (t *serviceBindingTrait) Configure(e *Environment) 
(bool, error) {
 }
 
 func (t *serviceBindingTrait) Apply(e *Environment) error {
-       integrationServiceBindingName := e.Integration.Name + 
"-service-binding-request"
        services, err := t.parseProvisionedServices(e)
        if err != nil {
                return err
@@ -76,19 +75,19 @@ func (t *serviceBindingTrait) Apply(e *Environment) error {
                return err
        }
        if len(services) > 0 {
-               serviceBindings = append(serviceBindings, 
integrationServiceBindingName)
+               serviceBindings = append(serviceBindings, e.Integration.Name)
        }
        if e.IntegrationInPhase(v1.IntegrationPhaseInitialization) {
                serviceBindingsCollectionReady := true
                for _, name := range serviceBindings {
-                       isIntSB := name == integrationServiceBindingName
+                       isIntSB := name == e.Integration.Name
                        serviceBinding, err := t.getServiceBinding(e, name)
                        // Do not throw an error if the ServiceBinding is not 
found and if we are managing it: we will create it
                        if (err != nil && !k8serrors.IsNotFound(err)) || (err 
!= nil && !isIntSB) {
                                return err
                        }
                        if isIntSB {
-                               request := createServiceBinding(e, services, 
integrationServiceBindingName)
+                               request := createServiceBinding(e, services, 
e.Integration.Name)
                                e.Resources.Add(&request)
                        }
                        if isCollectionReady(serviceBinding) {
@@ -134,8 +133,8 @@ func (t *serviceBindingTrait) Apply(e *Environment) error {
                                return nil
                        }
                        e.ServiceBindings[name] = sb.Status.Secret
-                       if name == integrationServiceBindingName {
-                               request := createServiceBinding(e, services, 
integrationServiceBindingName)
+                       if name == e.Integration.Name {
+                               request := createServiceBinding(e, services, 
e.Integration.Name)
                                e.Resources.Add(&request)
                        }
                }

Reply via email to