-
Notifications
You must be signed in to change notification settings - Fork 17
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
Deleting "shipwright-build-webhook" clusterrole and clusterrolebinding #214
Deleting "shipwright-build-webhook" clusterrole and clusterrolebinding #214
Conversation
54d25eb
to
9876329
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.
/approve
I added a few suggestions for comments and other nits - the logic to delete the webhook RBAC otherwise looks good to me. Adding "approve" so the rest of the community can add "lgtm" without me.
/hold
This PR needs to update the kodata/release.yaml
file to a v0.13.x release version. We currently have a v0.12.x version in-tree which includes the webhook rolebindings. If this code merges, I suspect the operator will hotloop trying to create and delete the RBAC objects.
|
||
err = deleteObjectsIfPresent(ctx, r.Client, []client.Object{ |
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.
We should have comment here explaining why this code exists:
err = deleteObjectsIfPresent(ctx, r.Client, []client.Object{ | |
// Builds 0.12.0 created a ClusterRole and ClusterRolebinding for the Build API conversion webhook. | |
// These were removed in v0.13.0 - when upgrading, these should be removed if present. | |
err = deleteObjectsIfPresent(ctx, r.Client, []client.Object{ |
&rbacv1.ClusterRole{ObjectMeta: metav1.ObjectMeta{Name: "shipwright-build-webhook"}}, | ||
}) | ||
if err != nil { | ||
logger.Error(err, "deleting'shipwright-build-webhook' role and cluster role binding") |
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.
nit - spelling and avoid use of quote characters. Logger tends to use structured format:
logger.Error(err, "deleting'shipwright-build-webhook' role and cluster role binding") | |
logger.Error(err, "deleting shipwright-build-webhook ClusterRole and ClusterRoleBinding") |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: adambkaplan 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 |
@ayushsatyam146 please also fill in the release note in the pull request description. This PR will include significant changes that warrant a release note for end users/admins. |
I was able to dig into the test failures so far - there's actually a few things going on here:
My recommendation - let's review and merge #215, then rebase this PR on top to include the other changes I outlined here. |
d55d7f8
to
8eb9633
Compare
Implementing a deleteObjectsIfPresent function and checking for presence of every resource and then deleting the given resource. Using this to delete "shipwright-build-webhook" clusterrole and clusterrolebinding Signed-off by : Ayush Satyam<[email protected]>
We currently have a v0.12.x version in-tree which includes the webhook rolebindings. We are updating the `kodata/release.yaml` with the latest v0.13.0 release. Signed-off by : Ayush Satyam<[email protected]>
8eb9633
to
fcca417
Compare
of shipwright-io/build. Updating the kodata/samples/buildstrategy files to use https://github.com/shipwright-io/build/releases/download/v0.13.0/sample-strategies.yaml Signed-off by : Ayush Satyam<[email protected]>
/assign @apoorvajagtap |
/hold cancel Rebased on top of my dependency PRs. |
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
Shipwright build version updated, along with the samples! 🎉 🎉 🎉
Implementing a deleteObjectsIfPresent function and checking for presence of every given resource and then deleting the given resource. Using this to delete "shipwright-build-webhook" clusterrole and clusterrolebinding. Addressing #181
Signed-off by : Ayush Satyam [email protected]
Changes
Submitter Checklist
See the contributor guide
for details on coding conventions, github and prow interactions, and the code review process.
Release Notes