mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-03 17:30:00 +00:00
Merge pull request #69828 from ironcladlou/e2e-psp-reentrancy-fix
Make CreatePrivilegedPSPBinding reentrant
This commit is contained in:
commit
c7886f8ba4
@ -113,7 +113,9 @@ func CreatePrivilegedPSPBinding(f *Framework, namespace string) {
|
|||||||
|
|
||||||
psp := PrivilegedPSP(podSecurityPolicyPrivileged)
|
psp := PrivilegedPSP(podSecurityPolicyPrivileged)
|
||||||
psp, err = f.ClientSet.ExtensionsV1beta1().PodSecurityPolicies().Create(psp)
|
psp, err = f.ClientSet.ExtensionsV1beta1().PodSecurityPolicies().Create(psp)
|
||||||
|
if !apierrs.IsAlreadyExists(err) {
|
||||||
ExpectNoError(err, "Failed to create PSP %s", podSecurityPolicyPrivileged)
|
ExpectNoError(err, "Failed to create PSP %s", podSecurityPolicyPrivileged)
|
||||||
|
}
|
||||||
|
|
||||||
if IsRBACEnabled(f) {
|
if IsRBACEnabled(f) {
|
||||||
// Create the Role to bind it to the namespace.
|
// Create the Role to bind it to the namespace.
|
||||||
@ -126,8 +128,10 @@ func CreatePrivilegedPSPBinding(f *Framework, namespace string) {
|
|||||||
Verbs: []string{"use"},
|
Verbs: []string{"use"},
|
||||||
}},
|
}},
|
||||||
})
|
})
|
||||||
|
if !apierrs.IsAlreadyExists(err) {
|
||||||
ExpectNoError(err, "Failed to create PSP role")
|
ExpectNoError(err, "Failed to create PSP role")
|
||||||
}
|
}
|
||||||
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
if IsRBACEnabled(f) {
|
if IsRBACEnabled(f) {
|
||||||
|
Loading…
Reference in New Issue
Block a user