You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ac...@apache.org on 2018/09/25 12:40:32 UTC

[camel-k] 01/01: Report correct build status in case of failure

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

acosentino pushed a commit to branch report-correct-status
in repository https://gitbox.apache.org/repos/asf/camel-k.git

commit c16e43cbda4604f2316b0bca6b6803cac5fc1ec3
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Tue Sep 25 14:39:42 2018 +0200

    Report correct build status in case of failure
---
 pkg/stub/action/integration/build.go | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/pkg/stub/action/integration/build.go b/pkg/stub/action/integration/build.go
index 4dcf728..20cd506 100644
--- a/pkg/stub/action/integration/build.go
+++ b/pkg/stub/action/integration/build.go
@@ -81,6 +81,15 @@ func (action *buildAction) Handle(integration *v1alpha1.Integration) error {
 			return sdk.Update(target)
 		}
 
+		if ctx.Status.Phase == v1alpha1.IntegrationContextPhaseError {
+			target := integration.DeepCopy()
+			target.Status.Image = ctx.Status.Image
+			target.Spec.Context = ctx.Name
+			target.Status.Phase = v1alpha1.IntegrationPhaseError
+			target.Status.Digest = digest.ComputeForIntegration(target)
+			return sdk.Update(target)
+		}
+
 		if integration.Spec.Context == "" {
 			// We need to set the context
 			target := integration.DeepCopy()