From f346f288e4f6b8a11613c430f5e3705f8ba64f23 Mon Sep 17 00:00:00 2001 From: Brady Siegel Date: Wed, 7 Dec 2022 16:45:14 +0000 Subject: [PATCH] Add helm testing for test ecr and prod ecr - Use -p to run against prod Signed-off-by: Brady Siegel --- e2e/helm_test.sh | 23 ++++++++++++++++++----- e2e/test-ecr.yaml | 14 ++++++++++++++ 2 files changed, 32 insertions(+), 5 deletions(-) mode change 100644 => 100755 e2e/helm_test.sh create mode 100644 e2e/test-ecr.yaml diff --git a/e2e/helm_test.sh b/e2e/helm_test.sh old mode 100644 new mode 100755 index ef80e97b..fb935d03 --- a/e2e/helm_test.sh +++ b/e2e/helm_test.sh @@ -38,10 +38,8 @@ print_line_separation() { set_variables() { DIR="$( dirname -- "$0"; )" K8S_NAMESPACE="aws-privateca-issuer" - HELM_CHART_NAME="$DIR/../charts/aws-pca-issuer" AWS_REGION="us-east-1" DEPLOYMENT_NAME="aws-privateca-issuer" - VALUES_FILE="$DIR/test-values.yaml" } clean_up() { @@ -52,19 +50,22 @@ clean_up() { } main() { + HELM_CHART_NAME="$1" + VALUES_FILE="$2" + set -eo pipefail check_is_installed kubectl "kubectl is not installed" check_is_installed helm "helm is not installed" - set_variables - clean_up set -e echo "Installing the Helm Chart $HELM_CHART_NAME in namespace $K8S_NAMESPACE ... " + helm repo add awspca https://cert-manager.github.io/aws-privateca-issuer + helm install "$DEPLOYMENT_NAME" "$HELM_CHART_NAME" --create-namespace --namespace "$K8S_NAMESPACE" -f $VALUES_FILE 1>/dev/null || exit 1 echo "Helm chart installed." @@ -118,6 +119,9 @@ main() { echo "uninstalling the Helm Chart $HELM_CHART_NAME in namespace $K8S_NAMESPACE ... " helm uninstall --namespace "$K8S_NAMESPACE" "$DEPLOYMENT_NAME" 1>/dev/null || exit 1 + echo "removing awspca repo" + helm repo remove awspca + echo "deleting $K8S_NAMESPACE namespace ... " kubectl delete namespace "$K8S_NAMESPACE" 1>/dev/null || exit 1 @@ -125,4 +129,13 @@ main() { } -main +set_variables + +if [ "$1" = "-p" ]; then + echo "Running against prod ecr" + main awspca/aws-privateca-issuer $DIR/test-values.yaml + exit +fi + +main $DIR/../charts/aws-pca-issuer $DIR/test-values.yaml +main awspca/aws-privateca-issuer $DIR/test-ecr.yaml diff --git a/e2e/test-ecr.yaml b/e2e/test-ecr.yaml new file mode 100644 index 00000000..7c38b2d9 --- /dev/null +++ b/e2e/test-ecr.yaml @@ -0,0 +1,14 @@ + +image: + repository: public.ecr.aws/cert-manager-aws-privateca-issuer/cert-manager-aws-privateca-issuer-test + pullPolicy: IfNotPresent + tag: "" + +volumeMounts: + - mountPath: /cache + name: cache-volume + +volumes: + - name: cache-volume + emptyDir: + sizeLimit: 500Mi