mirror of
https://github.com/projectcapsule/capsule.git
synced 2026-02-14 18:09:58 +00:00
test(e2e): support multiple tenant owners(add applications to act as tenant owners)
This commit is contained in:
committed by
Dario Tranchitella
parent
663ce93a3e
commit
db8b8ac1d9
@@ -35,8 +35,8 @@ func NewNamespace(name string) *corev1.Namespace {
|
||||
}
|
||||
}
|
||||
|
||||
func NamespaceCreation(ns *corev1.Namespace, t *capsulev1beta1.Tenant, timeout time.Duration) AsyncAssertion {
|
||||
cs := ownerClient(t)
|
||||
func NamespaceCreation(ns *corev1.Namespace, owner capsulev1beta1.OwnerSpec, timeout time.Duration) AsyncAssertion {
|
||||
cs := ownerClient(owner)
|
||||
return Eventually(func() (err error) {
|
||||
_, err = cs.CoreV1().Namespaces().Create(context.TODO(), ns, metav1.CreateOptions{})
|
||||
return
|
||||
@@ -68,11 +68,15 @@ func ModifyCapsuleConfigurationOpts(fn func(configuration *capsulev1alpha1.Capsu
|
||||
func KindInTenantRoleBindingAssertions(ns *corev1.Namespace, timeout time.Duration) (out []AsyncAssertion) {
|
||||
for _, rbn := range tenantRoleBindingNames {
|
||||
rb := &rbacv1.RoleBinding{}
|
||||
out = append(out, Eventually(func() string {
|
||||
out = append(out, Eventually(func() []string {
|
||||
if err := k8sClient.Get(context.TODO(), types.NamespacedName{Name: rbn, Namespace: ns.GetName()}, rb); err != nil {
|
||||
return ""
|
||||
return nil
|
||||
}
|
||||
return rb.Subjects[0].Kind
|
||||
var subjects []string
|
||||
for _, subject := range rb.Subjects {
|
||||
subjects = append(subjects, subject.Kind)
|
||||
}
|
||||
return subjects
|
||||
}, timeout, defaultPollInterval))
|
||||
}
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user