shipwright-io / operator

An operator to install and configure Shipwright Builds on Kubernetes clusters.
Apache License 2.0
19 stars 17 forks source link

Deleting "shipwright-build-webhook" clusterrole and clusterrolebinding #214

Closed ayushsatyam146 closed 4 months ago

ayushsatyam146 commented 5 months ago

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 asatyam@redhat.com

Changes

Submitter Checklist

See the contributor guide for details on coding conventions, github and prow interactions, and the code review process.

Release Notes

Deleting "shipwright-build-webhook" clusterrole and clusterrolebinding from the operator. 
Updating the `kodata/release.yaml` to v0.13.0 https://github.com/shipwright-io/build/releases/tag/v0.13.0) 
and updating all the references of v1alpha1 API to v1beta1 API.
openshift-ci[bot] commented 4 months ago

[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: - ~~[OWNERS](https://github.com/shipwright-io/operator/blob/main/OWNERS)~~ [adambkaplan] Approvers can indicate their approval by writing `/approve` in a comment Approvers can cancel approval by writing `/approve cancel` in a comment
adambkaplan commented 4 months ago

@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.

adambkaplan commented 4 months ago

I was able to dig into the test failures so far - there's actually a few things going on here:

  1. The sample build strategies are using the v1alpha1 api. These need to be migrated to the v1beta1 API because we switched the default storage to v1beta1, and Envtest does not support conversion webhooks.
    1. The easiest way to migrate the build strategies is to delete the separate sub-directories under kodata/samples/buildstrategies, and replace them with the v0.13.0 sample strategies yaml. If you save this file under kodata/samples/buildstrategies, no code changes are required in the operator.
    2. Doing this is not sufficient - the test code currently has its own mechanisms for extracting the build strategy names. This broke in my experiment - I replaced that logic with manifestival in https://github.com/shipwright-io/operator/pull/215, which has far more robust code for this sort of thing.
  2. The shipwright-io/build dependencies need to be updated to v0.13.0 - this is a standard golang bump go get github.com/shipwright-io/build@v0.13.0 && go mod tidy && go mod vendor
  3. Finally, any references to the shipwright-io/build v1alpha1 API should use the v1beta1 APIs instead.

My recommendation - let's review and merge #215, then rebase this PR on top to include the other changes I outlined here.

ayushsatyam146 commented 4 months ago

/assign @apoorvajagtap

adambkaplan commented 4 months ago

/hold cancel

Rebased on top of my dependency PRs.