Skip to content

Commit 22760da

Browse files
Use the main image when testing PRs targeting to release branches
1 parent 8f7adba commit 22760da

File tree

1 file changed

+18
-3
lines changed

1 file changed

+18
-3
lines changed

.github/workflows/test.yaml

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,26 @@ jobs:
4848

4949
- name: Run chart-testing (install)
5050
run: |
51-
OPERATOR_INSTALL=$(ct list-changed --config .github/ct.yaml | sed 's:charts/::' | grep "\-db$" | sed 's/-db$/-operator/')
51+
echo "Base branch is $GITHUB_BASE_REF"
52+
excluded_charts=("everest")
53+
OPERATOR_INSTALL=$(ct list-changed --config .github/ct.yaml | sed -E 's:charts/::' | awk '/(-db|-operator)$/ { sub(/-db$/, "-operator"); print }' | sort -u)
54+
5255
if [ -n "$OPERATOR_INSTALL" ]; then
53-
for operator in $OPERATOR_INSTALL; do helm install --namespace default $operator charts/$operator/.; done
56+
for operator in $OPERATOR_INSTALL; do
57+
HELM_ARGS=()
58+
if [[ "$GITHUB_BASE_REF" == release-* ]]; then
59+
IMAGE_NAME=$(yq e '.image.repository' "charts/$operator/values.yaml" | awk -F/ '{print $NF}')
60+
HELM_ARGS=(
61+
--set "image.repository=perconalab/$IMAGE_NAME"
62+
--set "image.tag=main"
63+
)
64+
fi
65+
helm install --namespace default $operator charts/$operator/. --wait --debug "${HELM_ARGS[@]}"
66+
excluded_charts+=($operator)
67+
done
5468
fi
55-
ct install --config .github/ct.yaml --excluded-charts=everest,pmm-ha,pmm-ha-dependencies
69+
70+
ct install --config .github/ct.yaml --excluded-charts=$(IFS=,; echo "${excluded_charts[*]}")
5671
5772
if [ -n "$OPERATOR_INSTALL" ]; then
5873
for operator in $OPERATOR_INSTALL; do helm uninstall --namespace default $operator; done

0 commit comments

Comments
 (0)