Remove temporary job to delete old monitoring stack, and fix kubebuilder RBAC #158
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This does two things:
main
branch.make manifests
.make manifests
is broken, because some privileges were manually added toconfig/rbac/role.yaml
which should be an auto-generated file.kubebuilder:rbac
comments inmain.go
. Thenmake manifests
is ran to properly re-generate therole.yaml
file.controller-gen
was bumped, to be able to include a header file making clear that therole.yaml
file should not be changed manually.How Has This Been Tested?
The revert of #146 removed a
Job
(manifest change), which can be seen clearly in the PR. It also changed therole.yaml
file (another manifest change). Since the revert just involves changes to manifests, only build correctness was verified by running: ´kustomize build config/base/´ and verifying no errors.The fix for
make manifests
involved regenerating therole.yaml
file. To verify that privileges of the role remain the same:role.yaml
frommain
branch:oc apply -f https://raw.githubusercontent.com/opendatahub-io/odh-model-controller/main/config/rbac/role.yaml
oc describe clusterrole odh-model-controller-role > role-before.txt
role.yaml
from this PR:oc apply -f config/rbac/role.yaml
. If should apply correctly, which would indicate a valid YAML.oc describe clusterrole odh-model-controller-role > role-after.txt
gvimdiff role-before role-after.txt
. You will see something like this (before at left, after at right):You will notice that 3 lines at the bottom are being removed from the role. That's OK because those privileges were needed only by the temporary
Job
that does cleanup of the old monitoring stack. Since theJob
is being removed (the revert) those privileges are no longer needed.You will also notice that the privileges for the
ServiceAccounts
is simply relocated with the same re-ordered privileges.Merge criteria:
make manifests
.