-
Notifications
You must be signed in to change notification settings - Fork 113
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 unknown strategy kind reconcile issue #1534
Conversation
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.
Looks mostly good. Do we have a test case for a standalone buildrun with an inline build spec with an invalid strategy kind?
3537f80
to
6d7c936
Compare
Another good catch. Looking into it. |
70a8b12
to
8fc7dae
Compare
This was actually more complicated than I thought. We kind of never had the same validations for the BuildSpec of an embedded BuildRun like the ones for a Build. I needed to refactor a little bit to get this one in. I think we should consider to refactor the whole validation code as it seems to be a bit of a patch work at this time. |
8fc7dae
to
06eafce
Compare
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.
/lgtm
// BuildRunFields runs field validations against a BuildRun to detect | ||
// disallowed field combinations | ||
// BuildRun runs field validations against a BuildRun to detect | ||
// disallowed field combinations and issues | ||
func BuildRunFields(buildRun *build.BuildRun) (string, string) { |
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.
Should not the comment start with the function name by convention ?
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.
Thanks. Fixed it.
@HeavyWombat on
I think the above didn't hold true, can you just comment on it, not to confuse people please. |
Yes, I went down a wrong path here. The validation was in place already, but later in reconcile function. It is fine where it is and I made sure to adopt back the changes that I introduced. We have a test case to catch the scenario. |
Ref: #1531 Set status when strategy kind is not one of the supported ones. Add test cases to strategy validation. Refactor strategy validation code to be more compact and readable. Signed-off-by: Matthias Diester <[email protected]>
Fix variable usage in message. Co-authored-by: Sascha Schwarze <[email protected]>
06eafce
to
1a6eb01
Compare
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.
/lgtm
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.
/approve
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: SaschaSchwarze0 The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Changes
Set status when strategy kind is not one of the supported ones.
Add test cases to strategy validation.
Refactor strategy validation code to be more compact and readable.
Fixes #1531
Submitter Checklist
See the contributor guide
for details on coding conventions, github and prow interactions, and the code review process.
Release Notes