@@ -1187,16 +1187,11 @@ wait 2
1187
1187
# Setup: use the service account just created. It does not have permissions
1188
1188
# on the default namespace, so it will give a permissions error on apply
1189
1189
# for anything attempted to apply to the default namespace.
1190
- echo " kubectl get sa user -ojsonpath='{.secrets[0].name}'"
1191
- SECRET_NAME=" $( kubectl get sa user -ojsonpath=' {.secrets[0].name}' ) "
1192
- if [[ -z " ${SECRET_NAME} " ]]; then
1193
- # K8s 1.24+ doesn't auto-generate service account secrets any more.
1194
- echo " kubectl apply -f e2e/live/testdata/rbac-error-step-2"
1195
- kubectl apply -f e2e/live/testdata/rbac-error-step-2 2>&1 | tee $OUTPUT_DIR /status
1196
- assertContains " secret/user-credentials created"
1197
- wait 2
1198
- SECRET_NAME=" user-credentials"
1199
- fi
1190
+ echo " kubectl apply -f e2e/live/testdata/rbac-error-step-2"
1191
+ kubectl apply -f e2e/live/testdata/rbac-error-step-2 2>&1 | tee $OUTPUT_DIR /status
1192
+ assertContains " secret/user-credentials created"
1193
+ wait 2
1194
+ SECRET_NAME=" user-credentials"
1200
1195
echo " kubectl get secrets -ojsonpath='{.data.token}' " ${SECRET_NAME} " | base64 -d"
1201
1196
SECRET_TOKEN=" $( kubectl get secrets -ojsonpath=' {.data.token}' " ${SECRET_NAME} " | base64 -d) "
1202
1197
echo " kubectl config set-credentials user --token \" <REDACTED>\" "
@@ -1446,16 +1441,11 @@ wait 2
1446
1441
# Setup: use the service account just created. It does not have permissions
1447
1442
# on the default namespace, so it will give a permissions error on apply
1448
1443
# for anything attempted to apply to the default namespace.
1449
- echo " kubectl get sa user -ojsonpath='{.secrets[0].name}'"
1450
- SECRET_NAME=" $( kubectl get sa user -ojsonpath=' {.secrets[0].name}' ) "
1451
- if [[ -z " ${SECRET_NAME} " ]]; then
1452
- # K8s 1.24+ doesn't auto-generate service account secrets any more.
1453
- echo " kubectl apply -f e2e/live/testdata/rbac-error-step-2"
1454
- kubectl apply -f e2e/live/testdata/rbac-error-step-2 2>&1 | tee $OUTPUT_DIR /status
1455
- assertContains " secret/user-credentials created"
1456
- wait 2
1457
- SECRET_NAME=" user-credentials"
1458
- fi
1444
+ echo " kubectl apply -f e2e/live/testdata/rbac-error-step-2"
1445
+ kubectl apply -f e2e/live/testdata/rbac-error-step-2 2>&1 | tee $OUTPUT_DIR /status
1446
+ assertContains " secret/user-credentials created"
1447
+ wait 2
1448
+ SECRET_NAME=" user-credentials"
1459
1449
echo " kubectl get secrets -ojsonpath='{.data.token}' " ${SECRET_NAME} " | base64 -d"
1460
1450
SECRET_TOKEN=" $( kubectl get secrets -ojsonpath=' {.data.token}' " ${SECRET_NAME} " | base64 -d) "
1461
1451
echo " kubectl config set-credentials user --token \" <REDACTED>\" "
0 commit comments