Skip to content

Commit f346f28

Browse files
committed
Add helm testing for test ecr and prod ecr
- Use -p to run against prod Signed-off-by: Brady Siegel <[email protected]>
1 parent ea6a61d commit f346f28

File tree

2 files changed

+32
-5
lines changed

2 files changed

+32
-5
lines changed

e2e/helm_test.sh

100644100755
Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,8 @@ print_line_separation() {
3838
set_variables() {
3939
DIR="$( dirname -- "$0"; )"
4040
K8S_NAMESPACE="aws-privateca-issuer"
41-
HELM_CHART_NAME="$DIR/../charts/aws-pca-issuer"
4241
AWS_REGION="us-east-1"
4342
DEPLOYMENT_NAME="aws-privateca-issuer"
44-
VALUES_FILE="$DIR/test-values.yaml"
4543
}
4644

4745
clean_up() {
@@ -52,19 +50,22 @@ clean_up() {
5250
}
5351

5452
main() {
53+
HELM_CHART_NAME="$1"
54+
VALUES_FILE="$2"
55+
5556
set -eo pipefail
5657

5758
check_is_installed kubectl "kubectl is not installed"
5859
check_is_installed helm "helm is not installed"
5960

60-
set_variables
61-
6261
clean_up
6362

6463
set -e
6564

6665
echo "Installing the Helm Chart $HELM_CHART_NAME in namespace $K8S_NAMESPACE ... "
6766

67+
helm repo add awspca https://cert-manager.github.io/aws-privateca-issuer
68+
6869
helm install "$DEPLOYMENT_NAME" "$HELM_CHART_NAME" --create-namespace --namespace "$K8S_NAMESPACE" -f $VALUES_FILE 1>/dev/null || exit 1
6970

7071
echo "Helm chart installed."
@@ -118,11 +119,23 @@ main() {
118119
echo "uninstalling the Helm Chart $HELM_CHART_NAME in namespace $K8S_NAMESPACE ... "
119120
helm uninstall --namespace "$K8S_NAMESPACE" "$DEPLOYMENT_NAME" 1>/dev/null || exit 1
120121

122+
echo "removing awspca repo"
123+
helm repo remove awspca
124+
121125
echo "deleting $K8S_NAMESPACE namespace ... "
122126
kubectl delete namespace "$K8S_NAMESPACE" 1>/dev/null || exit 1
123127

124128
echo "Helm Test Finished Successfully"
125129

126130
}
127131

128-
main
132+
set_variables
133+
134+
if [ "$1" = "-p" ]; then
135+
echo "Running against prod ecr"
136+
main awspca/aws-privateca-issuer $DIR/test-values.yaml
137+
exit
138+
fi
139+
140+
main $DIR/../charts/aws-pca-issuer $DIR/test-values.yaml
141+
main awspca/aws-privateca-issuer $DIR/test-ecr.yaml

e2e/test-ecr.yaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
2+
image:
3+
repository: public.ecr.aws/cert-manager-aws-privateca-issuer/cert-manager-aws-privateca-issuer-test
4+
pullPolicy: IfNotPresent
5+
tag: ""
6+
7+
volumeMounts:
8+
- mountPath: /cache
9+
name: cache-volume
10+
11+
volumes:
12+
- name: cache-volume
13+
emptyDir:
14+
sizeLimit: 500Mi

0 commit comments

Comments
 (0)