From 38b0165807b103f2949941c4a80a079176a966bf Mon Sep 17 00:00:00 2001 From: Matthew Wong Date: Wed, 9 Jun 2021 16:12:30 -0700 Subject: [PATCH] Make helm values, kops patch, and eksctl patch files optional --- hack/e2e/eksctl.sh | 4 +++- hack/e2e/kops.sh | 4 +++- hack/e2e/run.sh | 22 ++++++++++++++-------- 3 files changed, 20 insertions(+), 10 deletions(-) diff --git a/hack/e2e/eksctl.sh b/hack/e2e/eksctl.sh index 18beff750d..e069ec9cd8 100644 --- a/hack/e2e/eksctl.sh +++ b/hack/e2e/eksctl.sh @@ -43,7 +43,9 @@ function eksctl_create_cluster() { --dry-run \ "${CLUSTER_NAME}" > "${CLUSTER_FILE}" - eksctl_patch_cluster_file "$CLUSTER_FILE" "$EKSCTL_PATCH_FILE" + if test -f "$EKSCTL_PATCH_FILE"; then + eksctl_patch_cluster_file "$CLUSTER_FILE" "$EKSCTL_PATCH_FILE" + fi loudecho "Creating cluster $CLUSTER_NAME with $CLUSTER_FILE" ${BIN} create cluster -f "${CLUSTER_FILE}" --kubeconfig "${KUBECONFIG}" diff --git a/hack/e2e/kops.sh b/hack/e2e/kops.sh index 06fb856a31..f7fcb487a4 100644 --- a/hack/e2e/kops.sh +++ b/hack/e2e/kops.sh @@ -46,7 +46,9 @@ function kops_create_cluster() { -o json \ "${CLUSTER_NAME}" > "${CLUSTER_FILE}" - kops_patch_cluster_file "$CLUSTER_FILE" "$KOPS_PATCH_FILE" + if test -f "$KOPS_PATCH_FILE"; then + kops_patch_cluster_file "$CLUSTER_FILE" "$KOPS_PATCH_FILE" + fi loudecho "Creating cluster $CLUSTER_NAME with $CLUSTER_FILE" ${BIN} create --state "${KOPS_STATE_FILE}" -f "${CLUSTER_FILE}" diff --git a/hack/e2e/run.sh b/hack/e2e/run.sh index 4507e6451e..fd1c7fef2f 100755 --- a/hack/e2e/run.sh +++ b/hack/e2e/run.sh @@ -138,14 +138,20 @@ fi loudecho "Deploying driver" startSec=$(date +'%s') -"${HELM_BIN}" upgrade --install "${DRIVER_NAME}" \ - --namespace kube-system \ - --set image.repository="${IMAGE_NAME}" \ - --set image.tag="${IMAGE_TAG}" \ - -f "${HELM_VALUES_FILE}" \ - --wait \ - --kubeconfig "${KUBECONFIG}" \ - ./charts/"${DRIVER_NAME}" + +HELM_ARGS=(upgrade --install "${DRIVER_NAME}" + --namespace kube-system + --set image.repository="${IMAGE_NAME}" + --set image.tag="${IMAGE_TAG}" + --wait + --kubeconfig "${KUBECONFIG}" + ./charts/"${DRIVER_NAME}") +if test -f "$HELM_VALUES_FILE"; then + HELM_ARGS+=(-f "${HELM_VALUES_FILE}") +fi +set -x +"${HELM_BIN}" "${HELM_ARGS[@]}" +set +x if [[ -r "${EBS_SNAPSHOT_CRD}" ]]; then loudecho "Deploying snapshot CRD"