Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 3 additions & 9 deletions tests/e2e/lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -368,15 +368,9 @@ setup_generated_certs_for_test() {

setup_podsecuritypolicies_config() {
info "Set POD_SECURITY_POLICIES variable based on kubernetes version"
local version
version=$(kubectl version --output json)
local majorVersion
majorVersion=$(echo "$version" | jq -r .serverVersion.major)
local minorVersion
minorVersion=$(echo "$version" | jq -r .serverVersion.minor)

# PodSecurityPolicy was removed in version 1.25
if (( "$majorVersion" >= 1 && "$minorVersion" >= 25 )); then

SUPPORTS_PSP=$(kubectl api-resources | grep "podsecuritypolicies" -c || true)
if [[ "${SUPPORTS_PSP}" -eq 0 ]]; then
ci_export "POD_SECURITY_POLICIES" "false"
info "POD_SECURITY_POLICIES set to false"
else
Expand Down