Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automated cherry pick of #69828: Make CreatePrivilegedPSPBinding reentrant #77555

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 6 additions & 2 deletions test/e2e/framework/psp_util.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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")
}
}
})

Expand Down