mirror of
https://github.com/projectcapsule/capsule.git
synced 2026-04-29 14:06:37 +00:00
Support Groups as Subject Kind for Tenant Namespace RoleBindings created by Capsule (#71)
Modified CRD to support Owner struct. Added Tenant name validation webhook. Rewrote owner_reference hook logic. Updated and added new e2e tests. Co-authored-by: Maksim Fedotov <m_fedotov@wargaming.net>
This commit is contained in:
@@ -115,3 +115,14 @@ func ModifyCapsuleManagerPodArgs(args []string) {
|
||||
// had to add sleep in order to manager be started
|
||||
time.Sleep(defaultTimeoutInterval)
|
||||
}
|
||||
|
||||
func GroupShouldBeUsedInTenantRoleBinding(ns *corev1.Namespace, t *v1alpha1.Tenant, timeout time.Duration) {
|
||||
for _, roleBindingName := range tenantRoleBindingNames {
|
||||
tenantRoleBindig := &rbacv1.RoleBinding{}
|
||||
Eventually(func() string {
|
||||
Expect(k8sClient.Get(context.TODO(), types.NamespacedName{Name: roleBindingName, Namespace: ns.GetName()}, tenantRoleBindig)).Should(Succeed())
|
||||
return tenantRoleBindig.Subjects[0].Kind
|
||||
}, timeout, defaultPollInterval).Should(BeIdenticalTo("Group"))
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user