You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@camel.apache.org by GitBox <gi...@apache.org> on 2019/01/23 14:28:43 UTC

[GitHub] nicolaferraro commented on a change in pull request #351: build handlers: split buld step in two phases: submit and run

nicolaferraro commented on a change in pull request #351: build handlers: split buld step in two phases: submit and run
URL: https://github.com/apache/camel-k/pull/351#discussion_r250214794
 
 

 ##########
 File path: pkg/controller/integration/build_image.go
 ##########
 @@ -52,11 +52,41 @@ func (action *buildImageAction) Name() string {
 }
 
 func (action *buildImageAction) CanHandle(integration *v1alpha1.Integration) bool {
-	return integration.Status.Phase == v1alpha1.IntegrationPhaseBuildingImage
+	if integration.Status.Phase == v1alpha1.IntegrationPhaseBuildImageSubmitted {
+		return true
+	}
+	if integration.Status.Phase == v1alpha1.IntegrationPhaseBuildImageRunning {
+		return true
+	}
+
+	return false
 }
 
 func (action *buildImageAction) Handle(ctx context.Context, integration *v1alpha1.Integration) error {
+	if integration.Status.Phase == v1alpha1.IntegrationPhaseBuildImageSubmitted {
+		return action.handleBuildImageSubmitted(ctx, integration)
+	}
+	if integration.Status.Phase == v1alpha1.IntegrationPhaseBuildImageRunning {
+		return action.handleBuildImageRunning(ctx, integration)
+	}
+
+	return nil
+}
+
+func (action *buildImageAction) handleBuildImageRunning(ctx context.Context, integration *v1alpha1.Integration) error {
+	b, err := platform.GetPlatformBuilder(action.client, integration.Namespace)
+	if err != nil {
+		return err
+	}
+
+	if !b.IsBuilding(integration.ObjectMeta) {
 
 Review comment:
   Maybe typo

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services