You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by lb...@apache.org on 2019/03/13 06:50:19 UTC

[camel-k] branch master updated: fix bug due to state change during trait evaluation

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

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


The following commit(s) were added to refs/heads/master by this push:
     new 142362e  fix bug due to state change during trait evaluation
142362e is described below

commit 142362e38001d27aba1e8811e528514ff4b70a62
Author: nferraro <ni...@gmail.com>
AuthorDate: Wed Mar 13 02:08:42 2019 +0100

    fix bug due to state change during trait evaluation
---
 pkg/trait/deployment.go | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/pkg/trait/deployment.go b/pkg/trait/deployment.go
index dfcd9a7..30f9cea 100644
--- a/pkg/trait/deployment.go
+++ b/pkg/trait/deployment.go
@@ -75,11 +75,17 @@ func (t *deploymentTrait) Apply(e *Environment) error {
 		e.IntegrationInPhase(v1alpha1.IntegrationPhaseBuildingContext, v1alpha1.IntegrationPhaseResolvingContext) {
 
 		if t.deployer.ContainerImage {
-			// trigger container image build
-			e.Integration.Status.Phase = v1alpha1.IntegrationPhaseBuildImageSubmitted
+			e.PostProcessors = append(e.PostProcessors, func(environment *Environment) error {
+				// trigger container image build
+				e.Integration.Status.Phase = v1alpha1.IntegrationPhaseBuildImageSubmitted
+				return nil
+			})
 		} else {
-			// trigger integration deploy
-			e.Integration.Status.Phase = v1alpha1.IntegrationPhaseDeploying
+			e.PostProcessors = append(e.PostProcessors, func(environment *Environment) error {
+				// trigger integration deploy
+				e.Integration.Status.Phase = v1alpha1.IntegrationPhaseDeploying
+				return nil
+			})
 		}
 
 		return nil