lburgazzoli 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_r250221302
##########
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:
fixed
----------------------------------------------------------------
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:
[email protected]
With regards,
Apache Git Services