-
Notifications
You must be signed in to change notification settings - Fork 213
Bug 1881520: avoid hotlooping on RoleBindings with empty APIGroup #562
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
Bug 1881520: avoid hotlooping on RoleBindings with empty APIGroup #562
Conversation
|
@vrutkovs: This pull request references Bugzilla bug 1881520, which is valid. The bug has been moved to the POST state. The bug has been updated to refer to the pull request using the external bug tracker. 3 validation(s) were run on this bug
Requesting review from QA contact: DetailsIn response to this:
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. |
|
@vrutkovs: This pull request references Bugzilla bug 1881520, which is valid. 3 validation(s) were run on this bug
Requesting review from QA contact: DetailsIn response to this:
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. |
15b026d to
bc4c6c6
Compare
|
@vrutkovs: This pull request references Bugzilla bug 1881520, which is valid. 3 validation(s) were run on this bug
Requesting review from QA contact: DetailsIn response to this:
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. |
wking
left a comment
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
|
/hold This needs unit tests |
bc4c6c6 to
8f28251
Compare
|
@vrutkovs: This pull request references Bugzilla bug 1881520, which is valid. 3 validation(s) were run on this bug
Requesting review from QA contact: DetailsIn response to this:
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. |
|
/test unit Flake? |
|
/hold cancel Tests added, ready for review |
| @@ -1,6 +1,7 @@ | |||
| package resourcemerge | |||
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 might actually be able to drop this entirely, with:
$ oc adm release extract --to manifests quay.io/openshift-release-dev/ocp-release:4.8.0-fc.3-x86_64
$ grep -r10 v1beta1 manifests/ | grep ClusterRole
manifests/0000_80_machine-config-operator_03_rbac.yaml-kind: ClusterRoleBinding
manifests/0000_30_baremetal-operator_01_baremetalhost.crd.yaml-kind: ClusterRoleThe MCO has since bumped their version and the baremetal manifest doesn't have annotations to be included in any cluster profiles. So I expect we can drop this entirely, instead of fixing v1beta1 hotlooping.
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.
Part of dropping v1beta1 RBAC will be:
$ git --no-pager diff -U0 hack
diff --git a/hack/generate-lib-resources.py b/hack/generate-lib-resources.py
index 441e253d..294e9885 100755
--- a/hack/generate-lib-resources.py
+++ b/hack/generate-lib-resources.py
@@ -271 +270,0 @@ if __name__ == '__main__':
- types['k8s.io/api/rbac/v1beta1'] = types['k8s.io/api/rbac/v1']
@@ -282 +280,0 @@ if __name__ == '__main__':
- 'k8s.io/api/rbac/v1beta1': {'package': 'k8s.io/client-go/kubernetes/typed/rbac/v1beta1', 'type': 'RbacV1beta1Client'},although you'll also want #552, and you'll need to drop some remaining v1beta1 RBAC code like this resourcemerge stuff by hand.
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.
Good idea, dropped v1beta1
lib/resourcemerge/rbacv1beta1.go
Outdated
| package resourcemerge | ||
|
|
||
| import ( | ||
| rbacv1 "k8s.io/api/rbac/v1" |
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.
No need to mix in v1, v1beta1 has this too:
$ git --no-pager grep 'GroupName =' vendor/k8s.io/api/rbac/v1beta1
vendor/k8s.io/api/rbac/v1beta1/register.go:const GroupName = "rbac.authorization.k8s.io"Some manifests skip setting APIGroup in clusterbinding roleRefs, which makes CVO hotloop on these. This ensures empty api groups are being defaulted
8f28251 to
ca5dee3
Compare
wking
left a comment
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
/retest
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: vrutkovs, wking The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
/retest Please review the full test history for this PR and help us cut down flakes. |
|
/override ci/prow/e2e-agnostic-upgrade |
|
@wking: Overrode contexts on behalf of wking: ci/prow/e2e-agnostic-upgrade DetailsIn response to this:
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. |
|
@vrutkovs: All pull requests linked via external trackers have merged: Bugzilla bug 1881520 has been moved to the MODIFIED state. DetailsIn response to this:
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. |
|
/cherrypick release-4.7 |
|
@vrutkovs: new pull request created: #584 DetailsIn response to this:
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. |
EnsureRoleBindingandEnsureClusterRoleBindingexpectRoleRefsto be identical. Some manifests are skippingAPIGroup, so CVO keeps attempting to apply those on every sync.This PR adds
CompareRoleRefsv1/CompareRoleRefsv1beta1functions, which return true ("identical") if required APIGroup is empty and existing APIGroup is "rbac.authorization.k8s.io"TODO:
ensureRoleRefAPIGroup