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 8c599e6934f7d9e999dfd2f510f76be2ca62c9d2 Author: Antonin Stefanutti <anto...@stefanutti.fr> AuthorDate: Wed Sep 7 15:12:23 2022 +0200 fix: deployment trait should not run when waiting for platform --- pkg/trait/deployment.go | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/pkg/trait/deployment.go b/pkg/trait/deployment.go index 35a3eeada..ae4386372 100644 --- a/pkg/trait/deployment.go +++ b/pkg/trait/deployment.go @@ -46,16 +46,17 @@ func newDeploymentTrait() Trait { } func (t *deploymentTrait) Configure(e *Environment) (bool, error) { - if e.Integration == nil || !pointer.BoolDeref(t.Enabled, true) { - if e.Integration != nil { - e.Integration.Status.SetCondition( - v1.IntegrationConditionDeploymentAvailable, - corev1.ConditionFalse, - v1.IntegrationConditionDeploymentAvailableReason, - "explicitly disabled", - ) - } + if !e.IntegrationInRunningPhases() { + return false, nil + } + if !pointer.BoolDeref(t.Enabled, true) { + e.Integration.Status.SetCondition( + v1.IntegrationConditionDeploymentAvailable, + corev1.ConditionFalse, + v1.IntegrationConditionDeploymentAvailableReason, + "explicitly disabled", + ) return false, nil }