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

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


The following commit(s) were added to refs/heads/main by this push:
     new bdab8f3  Fix #2482: ServiceBinding CR should tied to the 
IntegrationPhaseWaitingForBindings Phase as well
bdab8f3 is described below

commit bdab8f3fe9526be7a7c25b085a6b4b0c67504648
Author: John Poth <poth.j...@gmail.com>
AuthorDate: Tue Jul 6 13:38:10 2021 +0200

    Fix #2482: ServiceBinding CR should tied to the 
IntegrationPhaseWaitingForBindings Phase as well
---
 pkg/trait/service_binding.go | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/pkg/trait/service_binding.go b/pkg/trait/service_binding.go
index 611a387..5c2fbe7 100644
--- a/pkg/trait/service_binding.go
+++ b/pkg/trait/service_binding.go
@@ -116,6 +116,10 @@ func (t *serviceBindingTrait) Apply(e *Environment) error {
                                setCollectionReady(e, name, 
corev1.ConditionFalse)
                                return nil
                        }
+                       if name == e.Integration.Name {
+                               request := createServiceBinding(e, services, 
name)
+                               e.Resources.Add(&request)
+                       }
                }
        } else if e.IntegrationInPhase(v1.IntegrationPhaseDeploying, 
v1.IntegrationPhaseRunning) {
                e.ServiceBindings = make(map[string]string)
@@ -134,7 +138,7 @@ func (t *serviceBindingTrait) Apply(e *Environment) error {
                        }
                        e.ServiceBindings[name] = sb.Status.Secret
                        if name == e.Integration.Name {
-                               request := createServiceBinding(e, services, 
e.Integration.Name)
+                               request := createServiceBinding(e, services, 
name)
                                e.Resources.Add(&request)
                        }
                }

Reply via email to