fix: sa binds rbac role (#2187)
* fix: sa binds rbac role Signed-off-by: wenhaozhou <wenhaozhou@yunify.com> * fix ut test Signed-off-by: wenhaozhou <wenhaozhou@yunify.com> * make goimports Signed-off-by: wenhaozhou <wenhaozhou@yunify.com> --------- Signed-off-by: wenhaozhou <wenhaozhou@yunify.com> Co-authored-by: wenhaozhou <wenhaozhou@yunify.com> Signed-off-by: hongming <coder.scala@gmail.com>
This commit is contained in:
committed by
hongming
parent
834c393cf0
commit
8286d4888e
@@ -37,6 +37,7 @@ var _ = Describe("ServiceAccount", func() {
|
||||
saName = "test-serviceaccount"
|
||||
saNamespace = "default"
|
||||
saRole = "test-role"
|
||||
refRole = "kubesphere:iam:test-role"
|
||||
)
|
||||
var role *rbacv1.Role
|
||||
var sa *corev1.ServiceAccount
|
||||
@@ -45,8 +46,11 @@ var _ = Describe("ServiceAccount", func() {
|
||||
BeforeEach(func() {
|
||||
role = &rbacv1.Role{
|
||||
ObjectMeta: metav1.ObjectMeta{
|
||||
Name: saRole,
|
||||
Name: refRole,
|
||||
Namespace: saNamespace,
|
||||
Labels: map[string]string{
|
||||
iamv1beta1.RoleReferenceLabel: saRole,
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user