Unverified Commit c7886f8b authored by k8s-ci-robot's avatar k8s-ci-robot Committed by GitHub

Merge pull request #69828 from ironcladlou/e2e-psp-reentrancy-fix

Make CreatePrivilegedPSPBinding reentrant
parents c1c718e5 0bef5e43
......@@ -113,7 +113,9 @@ func CreatePrivilegedPSPBinding(f *Framework, namespace string) {
psp := PrivilegedPSP(podSecurityPolicyPrivileged)
psp, err = f.ClientSet.ExtensionsV1beta1().PodSecurityPolicies().Create(psp)
ExpectNoError(err, "Failed to create PSP %s", podSecurityPolicyPrivileged)
if !apierrs.IsAlreadyExists(err) {
ExpectNoError(err, "Failed to create PSP %s", podSecurityPolicyPrivileged)
}
if IsRBACEnabled(f) {
// Create the Role to bind it to the namespace.
......@@ -126,7 +128,9 @@ func CreatePrivilegedPSPBinding(f *Framework, namespace string) {
Verbs: []string{"use"},
}},
})
ExpectNoError(err, "Failed to create PSP role")
if !apierrs.IsAlreadyExists(err) {
ExpectNoError(err, "Failed to create PSP role")
}
}
})
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment