Skip to content

Commit 7402427

Browse files
authored
fix helm sync script (#278)
1 parent e8deb6e commit 7402427

File tree

1 file changed

+11
-17
lines changed

1 file changed

+11
-17
lines changed

Diff for: test/helm-sync-test/run-helm-sync-test

+11-17
Original file line numberDiff line numberDiff line change
@@ -28,27 +28,21 @@ branches+=("master")
2828
clone_urls+=("https://github.com/aws/eks-charts.git")
2929

3030
for i in "${!branches[@]}"; do
31-
git clone --branch "${branches[$i]}" "${clone_urls[$i]}" $TMP_DIR/pr$i
32-
DIFF_OUTPUT=$(diff -r $TMP_DIR/pr$i/stable/aws-node-termination-handler $SCRIPTPATH/../../config/helm/aws-node-termination-handler)
33-
DIFF_ECODE=$?
34-
echo "$DIFF_OUTPUT" > $TMP_DIR/chart-diff-pr$i.txt
35-
36-
if [[ $DIFF_ECODE -eq 0 ]]; then
37-
if [[ $i -eq 0 ]]; then
38-
echo "✅ AWS Node Termination Handler helm chart is in-sync with the eks-charts repo!"
39-
else
40-
echo "✅ AWS Node Termination Handler helm chart is in-sync with a PR (${clone_urls[$i]} -branch ${branches[$i]}) in eks-charts repo!"
41-
fi
42-
exit 0
31+
git clone --branch "${branches[$i]}" "${clone_urls[$i]}" $TMP_DIR/pr$i || continue
32+
if [[ ! -d $TMP_DIR/pr$i/stable/aws-node-termination-handler ]]; then
33+
continue
34+
fi
35+
diff -r $TMP_DIR/pr$i/stable/aws-node-termination-handler $SCRIPTPATH/../../config/helm/aws-node-termination-handler | tee $TMP_DIR/chart-diff-pr$i.txt || continue
36+
37+
if [[ $i -eq 0 ]]; then
38+
echo "✅ AWS Node Termination Handler helm chart is in-sync with the eks-charts repo!"
4339
else
44-
echo "===================================== DIFF ========================================================"
45-
echo "${clone_urls[$i]} -branch ${branches[$i]}"
46-
echo "$DIFF_OUTPUT"
47-
echo "===================================== END DIFF ===================================================="
40+
echo "✅ AWS Node Termination Handler helm chart is in-sync with a PR (${clone_urls[$i]} -branch ${branches[$i]}) in eks-charts repo!"
4841
fi
42+
exit 0
4943
done
5044

51-
echo "❌ The Helm chart is NOT in-sync with the eks-charts repo. The diff is printed above. Please make a PR to eks-charts before merging this code."
45+
echo "❌ The Helm chart is NOT in-sync with the eks-charts repo. Please make a PR to eks-charts before merging this code."
5246
echo "Check $TMP_DIR for more details"
5347

5448
exit 1

0 commit comments

Comments
 (0)