Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add helm testing for test ecr and prod ecr #233

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
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
23 changes: 18 additions & 5 deletions e2e/helm_test.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand All @@ -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."
Expand Down Expand Up @@ -118,11 +119,23 @@ 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

echo "Helm Test Finished Successfully"

}

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
14 changes: 14 additions & 0 deletions e2e/test-ecr.yaml
Original file line number Diff line number Diff line change
@@ -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