Skip to content

Commit 6c3ea90

Browse files
committed
cleanup
1 parent 205639d commit 6c3ea90

3 files changed

Lines changed: 14 additions & 15 deletions

File tree

.github/workflows/e2e-rosa-tests.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ env:
2020
BENCHMARK_BUCKET: "s3://${{ vars.BENCHMARK_BUCKET }}"
2121
TAG_UNTESTED: "untested_${{ inputs.ref }}"
2222
TAG_PASSED: "test_passed_${{ inputs.ref }}"
23+
CLUSTER_TYPE: "openshift"
24+
CLUSTER_NAME: "s3-csi-${{ inputs.environment }}"
2325
jobs:
2426
build:
2527
runs-on: ubuntu-22.04 # FIXME - https://github.com/actions/runner-images/issues/11471
@@ -139,7 +141,6 @@ jobs:
139141
ACTION: "install_driver"
140142
TAG: "untested_${{ inputs.ref }}"
141143
CSI_DRIVER_IRSA_ROLE_ARN: "arn:aws:iam::${{ steps.aws-creds.outputs.aws-account-id }}:role/s3-csi-${{ inputs.environment }}-driver-irsa"
142-
IS_OPENSHIFT: "true"
143144
run: |
144145
tests/e2e-kubernetes/scripts/run.sh
145146
- name: Run E2E Tests
@@ -155,14 +156,13 @@ jobs:
155156
run: |
156157
tests/e2e-kubernetes/scripts/run.sh
157158
- name: Uninstall the driver
158-
if: always()
159+
# if: always()
159160
env:
160161
ACTION: "uninstall_driver"
161-
IS_OPENSHIFT: "true"
162162
run: |
163163
tests/e2e-kubernetes/scripts/run.sh
164164
- name: Delete ROSA cluster
165-
if: always()
165+
# if: always()
166166
env:
167167
TF_VAR_aws_region: "${{ vars.AWS_REGION }}"
168168
TF_VAR_cluster_name: "s3-csi-${{ inputs.environment }}"

tests/e2e-kubernetes/scripts/helm.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@ function helm_uninstall_driver() {
1919
KUBECTL_BIN=${2}
2020
RELEASE_NAME=${3}
2121
KUBECONFIG=${4}
22-
IS_OPENSHIFT=${5}
22+
CLUSTER_TYPE=${5}
2323

2424
if driver_installed ${HELM_BIN} ${RELEASE_NAME} ${KUBECONFIG}; then
25-
if [[ "${IS_OPENSHIFT}" == "true" ]]; then
25+
if [[ "${CLUSTER_TYPE}" == "openshift" ]]; then
2626
echo "OpenShift cluster detected - using graceful Helm uninstall as ClusterRoleBindings cannot be deleted due to admission webhooks."
2727
set +e
2828
$HELM_BIN uninstall $RELEASE_NAME --namespace kube-system --kubeconfig $KUBECONFIG
@@ -47,14 +47,14 @@ function helm_install_driver() {
4747
TAG=${5}
4848
KUBECONFIG=${6}
4949
CSI_DRIVER_IRSA_ROLE_ARN=${7}
50-
IS_OPENSHIFT=${8}
50+
CLUSTER_TYPE=${8}
5151

5252
helm_uninstall_driver \
5353
"$HELM_BIN" \
5454
"$KUBECTL_BIN" \
5555
"$RELEASE_NAME" \
5656
"$KUBECONFIG" \
57-
"$IS_OPENSHIFT"
57+
"$CLUSTER_TYPE"
5858

5959
if [[ -n "${CSI_DRIVER_IRSA_ROLE_ARN}" ]]; then
6060
echo "Configuring IRSA for CSI driver with role: ${CSI_DRIVER_IRSA_ROLE_ARN}"

tests/e2e-kubernetes/scripts/run.sh

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ IMDS_AVAILABLE=${IMDS_AVAILABLE:-true}
3232
ARCH=${ARCH:-x86}
3333
AMI_FAMILY=${AMI_FAMILY:-AmazonLinux2}
3434
SELINUX_MODE=${SELINUX_MODE:-}
35-
IS_OPENSHIFT=${IS_OPENSHIFT:-false}
3635

3736
# eksctl: mustn't include patch version (e.g. 1.19)
3837
# 'K8S_VERSION' variable must be a full version (e.g. 1.19.1)
@@ -41,11 +40,11 @@ K8S_VERSION_EKSCTL=${K8S_VERSION_EKSCTL:-${K8S_VERSION%.*}}
4140

4241
# We need to ensure that we're using all testing matrix variables in the cluster name
4342
# because they all run in parallel and conflicting name would break other tests.
44-
CLUSTER_NAME="s3-csi-cluster-${CLUSTER_TYPE}-${AMI_FAMILY,,}-${ARCH}"
45-
46-
if [[ "${CLUSTER_TYPE}" == "eksctl" ]]; then
43+
if [[ "${CLUSTER_TYPE}" == "openshift" ]]; then
44+
CLUSTER_NAME=${CLUSTER_NAME:-"s3-csi-rosa"}
45+
elif [[ "${CLUSTER_TYPE}" == "eksctl" ]]; then
4746
# EKS does not allow cluster names with ".", we're replacing them with "-".
48-
CLUSTER_NAME="${CLUSTER_NAME}-${K8S_VERSION_EKSCTL/./-}"
47+
CLUSTER_NAME="s3-csi-cluster-${CLUSTER_TYPE}-${AMI_FAMILY,,}-${ARCH}-${K8S_VERSION_EKSCTL/./-}"
4948
else
5049
echo "Unsupported cluster type: ${CLUSTER_TYPE}."
5150
exit 1
@@ -173,7 +172,7 @@ elif [[ "${ACTION}" == "install_driver" ]]; then
173172
"${TAG}" \
174173
"${KUBECONFIG}" \
175174
"${CSI_DRIVER_IRSA_ROLE_ARN}" \
176-
"${IS_OPENSHIFT}"
175+
"${CLUSTER_TYPE}"
177176
elif [[ "${ACTION}" == "run_tests" ]]; then
178177
set +e
179178
pushd tests/e2e-kubernetes
@@ -203,7 +202,7 @@ elif [[ "${ACTION}" == "uninstall_driver" ]]; then
203202
"$KUBECTL_BIN" \
204203
"$HELM_RELEASE_NAME" \
205204
"${KUBECONFIG}" \
206-
"${IS_OPENSHIFT}"
205+
"${CLUSTER_TYPE}"
207206
elif [[ "${ACTION}" == "delete_cluster" ]]; then
208207
delete_cluster
209208
elif [[ "${ACTION}" == "e2e_cleanup" ]]; then

0 commit comments

Comments
 (0)