Skip to content

Commit b60bbfe

Browse files
Merge pull request #30427 from tchap/restricted-v3-finishing-touches
CNTRLPLANE-1544: tests: authorization/rbac: Align restricted-v3 rule
2 parents 32a91eb + 3365735 commit b60bbfe

File tree

1 file changed

+1
-16
lines changed

1 file changed

+1
-16
lines changed

test/extended/authorization/rbac/groups_default_rules.go

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@ import (
77

88
g "github.com/onsi/ginkgo/v2"
99
o "github.com/onsi/gomega"
10-
apierrors "k8s.io/apimachinery/pkg/api/errors"
11-
1210
corev1 "k8s.io/api/core/v1"
1311
rbacv1 "k8s.io/api/rbac/v1"
1412
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
@@ -126,8 +124,7 @@ var (
126124
rbacv1helpers.NewRule("list", "watch").Groups(projectGroup, legacyProjectGroup).Resources("projects").RuleOrDie(),
127125

128126
rbacv1helpers.NewRule("use").Groups(security.GroupName).Resources("securitycontextconstraints").Names("restricted-v2").RuleOrDie(),
129-
// TODO: Uncomment this once https://github.com/openshift/cluster-kube-apiserver-operator/pull/1944 is merged.
130-
// rbacv1helpers.NewRule("use").Groups(security.GroupName).Resources("securitycontextconstraints").Names("restricted-v3").RuleOrDie(),
127+
rbacv1helpers.NewRule("use").Groups(security.GroupName).Resources("securitycontextconstraints").Names("restricted-v3").RuleOrDie(),
131128

132129
// TODO: remove when openshift-apiserver has removed these
133130
rbacv1helpers.NewRule("get").URLs(
@@ -246,18 +243,6 @@ var _ = g.Describe("[sig-auth][Feature:OpenShiftAuthorization] The default clust
246243
exutil.FatalErr("failed to sync RBAC cache")
247244
}
248245

249-
// Temporary fix for https://github.com/openshift/cluster-kube-apiserver-operator/pull/1944
250-
// Add a rule for restricted-v3 to the list in case the associated ClusterRoleBinding exists.
251-
// TODO: Remove the following block once merged.
252-
if _, err := kubeInformers.Rbac().V1().ClusterRoleBindings().Lister().Get("system:openshift:scc:restricted-v3"); err != nil {
253-
if !apierrors.IsNotFound(err) {
254-
o.Expect(err).NotTo(o.HaveOccurred())
255-
}
256-
} else {
257-
allAuthenticatedRules = append(allAuthenticatedRules,
258-
rbacv1helpers.NewRule("use").Groups(security.GroupName).Resources("securitycontextconstraints").Names("restricted-v3").RuleOrDie())
259-
}
260-
261246
namespaces, err := oc.AdminKubeClient().CoreV1().Namespaces().List(ctx, metav1.ListOptions{})
262247
if err != nil {
263248
exutil.FatalErr(err)

0 commit comments

Comments
 (0)