-
Notifications
You must be signed in to change notification settings - Fork 352
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: Nil pointer on build failure recovery #805
Conversation
pkg/controller/build/recovery.go
Outdated
build.Status = v1alpha1.BuildStatus{} | ||
build.Status = v1alpha1.BuildStatus{ | ||
Failure: build.Status.Failure.DeepCopy(), | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah it is created beforehand. But build.Status is then reinitialized and currently it is not setting up the Failure
field. Not sure whether this is actually needed or not.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah it does not make sense, seems a mistake
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the status update seems a mistake too
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep - that does seem wrong.
Ok - I'll fix those bits up and retest shortly.
4e7c1df
to
6b3edd8
Compare
pkg/controller/build/recovery.go
Outdated
@@ -87,8 +87,6 @@ func (action *errorRecoveryAction) Handle(ctx context.Context, build *v1alpha1.B | |||
return nil, nil | |||
} | |||
|
|||
build.Status = v1alpha1.BuildStatus{} | |||
build.Status.Phase = v1alpha1.BuildPhaseInitialization |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think resetting the phase is needed otherwise the build won'r be triggered again, isn't it ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep - Sorry, that wasn't meant to be removed. I misinterpreted your earlier comments. That's fixed now.
However, when testing on top of the latest changes, if I provide an invalid dependency to kamel run
, the build is actually somehow successful. That's definitely not the behaviour when I force HEAD back to cb988c7, the build fails and the recovery loop kicks in as expected.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
interesting, do you have time to investigate ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I'll take a look tomorrow.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we're good to merge this now that we have #807 fixed.
6b3edd8
to
dca81b3
Compare
fixes #804