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

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

commit 97db011f65b581c0ae53cde95497267df1622227
Author: Antonin Stefanutti <[email protected]>
AuthorDate: Tue Dec 17 12:23:41 2019 +0100

    chore(build): Recover the build when in-memory state is inconsistent
---
 pkg/controller/build/monitor_routine.go | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/pkg/controller/build/monitor_routine.go 
b/pkg/controller/build/monitor_routine.go
index c1fc7da..3c61cf0 100644
--- a/pkg/controller/build/monitor_routine.go
+++ b/pkg/controller/build/monitor_routine.go
@@ -49,10 +49,10 @@ func (action *monitorRoutineAction) CanHandle(build 
*v1alpha1.Build) bool {
 // Handle handles the builds
 func (action *monitorRoutineAction) Handle(ctx context.Context, build 
*v1alpha1.Build) (*v1alpha1.Build, error) {
        // Check the build routine
-       if _, ok := action.routines.Load(build.Name); !ok {
-               // and reschedule the build if it's missing. This can happen 
when the operator
-               // stops abruptly and restarts.
-               build.Status.Phase = v1alpha1.BuildPhaseScheduling
+       if _, ok := action.routines.Load(build.Name); !ok && build.Status.Phase 
!= v1alpha1.BuildPhaseFailed {
+               // and recover the build if it's missing. This can happen when 
the operator
+               // stops abruptly and restarts or the build status update fails.
+               build.Status.Phase = v1alpha1.BuildPhaseFailed
 
                return build, nil
        }

Reply via email to