-
Notifications
You must be signed in to change notification settings - Fork 244
OCPBUGS-48425: ovn-k, rbac: Enable users read & modify UserDefinedNetwork CRs #2619
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
OCPBUGS-48425: ovn-k, rbac: Enable users read & modify UserDefinedNetwork CRs #2619
Conversation
b4546db
to
4514299
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.
/lgtm
Did you check this works manually ?
@ormergi need to adjust the unit tests as well. |
@ormergi: This pull request references Jira Issue OCPBUGS-48425, which is invalid:
Comment The bug has been updated to refer to the pull request using the external bug tracker. In 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 openshift-eng/jira-lifecycle-plugin repository. |
Enable non cluster-admin users read UserDefinedNetwork CRs. Signed-off-by: Or Mergi <[email protected]>
4514299
to
6b36e6e
Compare
6b36e6e
to
1f56bdf
Compare
Changes: Fix UT, consider net-seg FG |
@maiqueb PTAL 🙏 |
1f56bdf
to
c389698
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.
/lgtm
pkg/network/ovn_kubernetes_test.go
Outdated
@@ -4052,7 +4052,7 @@ func Test_renderOVNKubernetes(t *testing.T) { | |||
client: cnofake.NewFakeClient(), | |||
featureGates: udnFeatureGate, | |||
}, | |||
expectNumObjs: 41, | |||
expectNumObjs: 42, |
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.
would it make sense to add another test without the feat gate enabled and keep expecting 41 ?...
Just a nit, probably makes no sense to test the feature gate ...
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.
There are two other test right above this one that run with and w/o the network-segmentation FG
cluster-network-operator/pkg/network/ovn_kubernetes_test.go
Lines 4021 to 4045 in c389698
name: "default", | |
args: args{ | |
conf: fakeNetworkConf, | |
bootstrapResult: fakeBootstrapResultOVN, | |
manifestDir: manifestDirOvn, | |
client: cnofake.NewFakeClient(), | |
featureGates: noFeatureGates, | |
}, | |
expectNumObjs: 37, | |
}, | |
{ | |
name: "render routeadvertisements", | |
args: args{ | |
conf: func() *operv1.NetworkSpec { | |
config := fakeNetworkConf() | |
config.DefaultNetwork.OVNKubernetesConfig.RouteAdvertisements = operv1.RouteAdvertisementsEnabled | |
return config | |
}, | |
bootstrapResult: fakeBootstrapResultOVN, | |
manifestDir: manifestDirOvn, | |
client: cnofake.NewFakeClient(), | |
featureGates: noFeatureGates, | |
}, | |
expectNumObjs: 38, | |
}, |
/jira refresh |
@ormergi: This pull request references Jira Issue OCPBUGS-48425, which is invalid:
Comment In 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 openshift-eng/jira-lifecycle-plugin repository. |
/jira refresh |
@ormergi: This pull request references Jira Issue OCPBUGS-48425, which is invalid:
Comment In 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 openshift-eng/jira-lifecycle-plugin repository. |
/jira refresh |
The UserDefinedNetwork (UDN) CRD is targeted for non cluster-admin (e.g: project-admins) users enabling self-service OVN-K overlay networks w/o the cluster-amdin intervention [1]. The existing "openshift-ovn-kubernetes-cluster-reader" cluster-role doesn't affect all non-admin users in the cluster, requiring the admin to grant cluster-reader permissions. Add UDN reader cluster-role, utilizing cluster-role aggregation [2] to add the permissions to the built-in "view" cluster-role. Add UDN editor clsuter-role, utilizing cluster-role aggregation [2] to add the permissions to the built-in "edit" cluster-role. For completeness, add UDN read permissions to the existing cluster-role: "openshift-ovn-kubernetes-cluster-reader" [1] https://issues.redhat.com/browse/RFE-5530 [2] https://kubernetes.io/docs/reference/access-authn-authz/rbac/#aggregated-clusterroles Signed-off-by: Or Mergi <[email protected]>
5592aff
to
976710d
Compare
|
Verified against cluster-bot cluster using the following command @maiqueb PTAL |
@@ -13,6 +13,9 @@ rules: | |||
- egressqoses | |||
- egressservices | |||
- adminpolicybasedexternalroutes | |||
{{- if .OVN_NETWORK_SEGMENTATION_ENABLE }} | |||
- userdefinednetworks |
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.
What about CUDN?
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.
CUDN CRD is targeted for cluster-admin users, I think it should not be part of the ovn cluster-reader role, at least not by default. WDYT?
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.
Other resources in this group are also cluster wide objects meant to be configured by admins.
I don't mind adding it as a followup.
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: kyrtapz, maiqueb, ormergi 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 |
/retest-required |
2 similar comments
/retest-required |
/retest-required |
/retest |
/label acknowledge-critical-fixes-only |
/test ci/prow/security |
@ormergi: The specified target(s) for
The following commands are available to trigger optional jobs:
Use
In 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-sigs/prow repository. |
/test security |
0dfccc1
into
openshift:master
@ormergi: Jira Issue OCPBUGS-48425: All pull requests linked via external trackers have merged: Jira Issue OCPBUGS-48425 has been moved to the MODIFIED state. In 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 openshift-eng/jira-lifecycle-plugin repository. |
@ormergi: #2619 failed to apply on top of branch "release-4.18":
In 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-sigs/prow repository. |
/cherry-pick release-4.18 |
@ormergi: #2619 failed to apply on top of branch "release-4.18":
In 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-sigs/prow repository. |
[ART PR BUILD NOTIFIER] Distgit: cluster-network-operator |
/cherry-pick release-4.18 |
@ormergi: #2619 failed to apply on top of branch "release-4.18":
In 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-sigs/prow repository. |
This PR introduce new ClusterRole allowing non clsuter-admin users (i.e.: project-admins) create & modify UserDefinedNetwork CRs, allowing self-servicing OVN-K overlay networks w/o the cluster-admin intervention.
Addressing [1].
[1] https://issues.redhat.com/browse/RFE-5530