Skip to content
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

Merged
merged 1 commit into from
Jul 6, 2019

Conversation

jamesnetherton
Copy link
Contributor

fixes #804

build.Status = v1alpha1.BuildStatus{}
build.Status = v1alpha1.BuildStatus{
Failure: build.Status.Failure.DeepCopy(),
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks strange as this struct should have been created here, looking at the code there is a suspicious status update that should not be there as the update is performed by the controller.

Copy link
Contributor Author

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.

Copy link
Contributor

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

Copy link
Contributor

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

Copy link
Contributor Author

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.

@jamesnetherton jamesnetherton force-pushed the 804-build-failure branch 2 times, most recently from 4e7c1df to 6b3edd8 Compare July 4, 2019 13:54
@@ -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
Copy link
Contributor

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 ?

Copy link
Contributor Author

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.

Copy link
Contributor

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 ?

Copy link
Contributor Author

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.

Copy link
Contributor Author

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.

@lburgazzoli lburgazzoli added the status/wip Work in progress label Jul 4, 2019
@lburgazzoli lburgazzoli merged commit efa72a4 into apache:master Jul 6, 2019
@jamesnetherton jamesnetherton deleted the 804-build-failure branch July 7, 2019 08:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status/wip Work in progress
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Nil pointer on build failure recovery
3 participants