Skip to content

Commit

Permalink
Merge pull request #18372 from danwinship/fix-networkpolicy-rbac-policy
Browse files Browse the repository at this point in the history
Automatic merge from submit-queue (batch tested with PRs 18044, 18372, 18354).

Re-fix NetworkPolicy bootstrap policies

#17976 "use cluster role aggregation for admin, edit, and view" removed permission for "admin" and "edit" on extensions.NetworkPolicy (but not networking.NetworkPolicy). It appears to have been a mistake?

Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1538048
  • Loading branch information
openshift-merge-robot committed Feb 1, 2018
2 parents 76d83fa + 2f5ecc3 commit 45446c3
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/cmd/server/bootstrappolicy/policy.go
Expand Up @@ -305,7 +305,7 @@ func GetOpenshiftBootstrapClusterRoles() []rbac.ClusterRole {

rbac.NewRule(readWrite...).Groups(templateGroup, legacyTemplateGroup).Resources("templates", "templateconfigs", "processedtemplates", "templateinstances").RuleOrDie(),

rbac.NewRule(readWrite...).Groups(networkingGroup).Resources("networkpolicies").RuleOrDie(),
rbac.NewRule(readWrite...).Groups(extensionsGroup, networkingGroup).Resources("networkpolicies").RuleOrDie(),

// backwards compatibility
rbac.NewRule(readWrite...).Groups(buildGroup, legacyBuildGroup).Resources("buildlogs").RuleOrDie(),
Expand Down Expand Up @@ -347,7 +347,7 @@ func GetOpenshiftBootstrapClusterRoles() []rbac.ClusterRole {

rbac.NewRule(readWrite...).Groups(templateGroup, legacyTemplateGroup).Resources("templates", "templateconfigs", "processedtemplates", "templateinstances").RuleOrDie(),

rbac.NewRule(readWrite...).Groups(networkingGroup).Resources("networkpolicies").RuleOrDie(),
rbac.NewRule(readWrite...).Groups(extensionsGroup, networkingGroup).Resources("networkpolicies").RuleOrDie(),

// backwards compatibility
rbac.NewRule(readWrite...).Groups(buildGroup, legacyBuildGroup).Resources("buildlogs").RuleOrDie(),
Expand Down
2 changes: 2 additions & 0 deletions test/testdata/bootstrappolicy/bootstrap_cluster_roles.yaml
Expand Up @@ -867,6 +867,7 @@ items:
- update
- watch
- apiGroups:
- extensions
- networking.k8s.io
resources:
- networkpolicies
Expand Down Expand Up @@ -1108,6 +1109,7 @@ items:
- update
- watch
- apiGroups:
- extensions
- networking.k8s.io
resources:
- networkpolicies
Expand Down
2 changes: 2 additions & 0 deletions test/testdata/bootstrappolicy/bootstrap_policy_file.yaml
Expand Up @@ -947,6 +947,7 @@ items:
- update
- watch
- apiGroups:
- extensions
- networking.k8s.io
attributeRestrictions: null
resources:
Expand Down Expand Up @@ -1210,6 +1211,7 @@ items:
- update
- watch
- apiGroups:
- extensions
- networking.k8s.io
attributeRestrictions: null
resources:
Expand Down

0 comments on commit 45446c3

Please sign in to comment.