Skip to content

Commit 2a42af8

Browse files
committed
this interface sucks
Signed-off-by: Monis Khan <[email protected]>
1 parent f42a6f4 commit 2a42af8

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

pkg/cmd/admin/policy/policy.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package policy
22

33
import (
4-
"errors"
54
"fmt"
65
"io"
76

@@ -186,8 +185,9 @@ func NewClusterRoleBindingAccessor(client client.Interface) ClusterRoleBindingAc
186185
}
187186

188187
func (a ClusterRoleBindingAccessor) GetExistingRoleBindingsForRole(roleNamespace, role string) ([]*authorizationapi.RoleBinding, error) {
188+
// cluster role bindings can only reference cluster roles
189189
if roleNamespace != "" {
190-
return nil, errors.New("cluster role bindings can only reference cluster roles")
190+
return nil, nil
191191
}
192192

193193
existingBindings, err := a.Client.ClusterRoleBindings().List(metav1.ListOptions{})

test/cmd/policy-storage-admin.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ os::cmd::expect_success_and_text 'oc policy can-i create pv' 'yes'
3131
os::cmd::expect_success_and_text 'oc policy can-i create storageclass' 'yes'
3232

3333
# Test failure to change policy on users for storage-admin
34-
os::cmd::expect_failure_and_text 'oc policy add-role-to-user admin storage-adm' 'cannot get policybindings'
35-
os::cmd::expect_failure_and_text 'oc policy remove-user screeley' 'cannot list policybindings'
34+
os::cmd::expect_failure_and_text 'oc policy add-role-to-user admin storage-adm' 'cannot list rolebindings'
35+
os::cmd::expect_failure_and_text 'oc policy remove-user screeley' 'cannot list rolebindings'
3636
os::cmd::expect_success 'oc logout'
3737

3838
# Test that scoped storage-admin now an admin in project foo

0 commit comments

Comments
 (0)