-
Notifications
You must be signed in to change notification settings - Fork 545
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
[WIP] refactor operator group cluster role name #2991
Conversation
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: perdasilva 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 |
560c977
to
f895696
Compare
21b16d0
to
399be1d
Compare
d45829f
to
1134900
Compare
1134900
to
89edf44
Compare
771c01e
to
1785049
Compare
736a801
to
c06c834
Compare
So the main takeaways are that this change:
My initial thoughts:
|
@awgreene good call out on Steve's PR. I'll rebase and add that label to the role, if he hasn't already. We've created our own "owner refs" as labels on the ClusterRole. So, it should be straightforward to identify the ClusterRoles. Using ns/name was my first thought for a hash - @kevinrizza called out that it could leak information (i.e. people could use guessing attacks). The resource ID is stable and should lead to predictable values (at least for the lifetime of the object). wdyt? |
c06c834
to
eb54958
Compare
eb54958
to
8780b9e
Compare
In a lot of the test code, there's odd white-space changes, which can probably be undone. |
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.
Some nits. and a bunch of unrelated changes that ought to be resolved.
I guess my biggest concern is with the new naming of the ClusterRoles
99a490a
to
a8c1772
Compare
a8c1772
to
b6067cb
Compare
if err == nil { | ||
|
||
if existingRole != nil { | ||
// if the existing role conforms to the naming convention, check for skew |
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.
Prefer semantic.Equality
for checks on k8s objects. Sometimes thing like order in arrays matters.
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.
Or, alternatively, simply use server-side apply to assert that the state you want for the object is right. k8s server will do any diffs you need and even create if not existing.
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.
Does this block this PR?
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.
Yes
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.
updating using equality.Semantic
- I haven't used SSA. I'd need a bit more time. If you want I can create an issue to move to SSA.
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.
That's fine for now. SSA issue for the future would be good. More important that we do it in every case for v1 than we go back to improve every possible case in v0.
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.
Locked in - I'll keep that in mind for reviews! Ty
Still looking to get those unnecessary formatting changes in |
Signed-off-by: Per Goncalves da Silva <pegoncal@redhat.com>
Signed-off-by: Per Goncalves da Silva <pegoncal@redhat.com>
Signed-off-by: Per Goncalves da Silva <pegoncal@redhat.com>
…the cluster role Signed-off-by: Per Goncalves da Silva <pegoncal@redhat.com>
Signed-off-by: Per Goncalves da Silva <pegoncal@redhat.com>
dbe5062
to
e3b7132
Compare
PR needs rebase. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
Closing due to #3035 |
Description of the change:
In its current implementation, OLM creates three cluster roles for and operator-group: -admin, -view, and -edit.
Motivation for the change:
OCPBUGS-14698
Architectural changes:
The cluster role name format was changed to:
olm.operatorgroup.{admin|edit | view}
Testing remarks:
When this hits a running cluster, it will abandon the currently existing cluster roles in favor of new ones that respect the new format. This means that additional migration information will need to be provided in documentation.
The unit tests check that the appropriate cluster roles are created whether or not there is a currently existing. E2e tests responsible for the cluster role creation were also updated for the new format.
Reviewer Checklist
/doc
[FLAKE]
are truly flaky and have an issue