Skip to content

Commit be0fe12

Browse files
committed
fix(chart): remove hook post-upgrade, add test for chart upgrade capability
Signed-off-by: Viet Nguyen Duc <[email protected]>
1 parent bd50206 commit be0fe12

File tree

6 files changed

+21
-8
lines changed

6 files changed

+21
-8
lines changed

Diff for: .github/workflows/helm-chart-test.yml

+10
Original file line numberDiff line numberDiff line change
@@ -42,32 +42,38 @@ jobs:
4242
cluster: 'kind'
4343
helm-version: 'v3.10.3'
4444
test-existing-keda: true
45+
test-upgrade: true
4546
- k8s-version: 'v1.26.15'
4647
test-strategy: deployment
4748
cluster: 'minikube'
4849
helm-version: 'v3.11.3'
4950
test-existing-keda: true
51+
test-upgrade: true
5052
- k8s-version: 'v1.27.12'
5153
test-strategy: job_https
5254
cluster: 'minikube'
5355
helm-version: 'v3.12.3'
5456
test-existing-keda: true
57+
test-upgrade: true
5558
- k8s-version: 'v1.28.8'
5659
test-strategy: job_hostname
5760
cluster: 'minikube'
5861
helm-version: 'v3.13.3'
5962
test-existing-keda: false
63+
test-upgrade: true
6064
- k8s-version: 'v1.29.3'
6165
test-strategy: deployment_https
6266
cluster: 'minikube'
6367
helm-version: 'v3.14.3'
6468
test-existing-keda: false
69+
test-upgrade: true
6570
env:
6671
CLUSTER: ${{ matrix.cluster }}
6772
KUBERNETES_VERSION: ${{ matrix.k8s-version }}
6873
ARTIFACT_NAME: ${{ matrix.k8s-version }}-${{ matrix.test-strategy }}
6974
HELM_VERSION: ${{ matrix.helm-version }}
7075
TEST_EXISTING_KEDA: ${{ matrix.test-existing-keda }}
76+
TEST_UPGRADE_CHART: ${{ matrix.test-upgrade }}
7177
steps:
7278
- uses: actions/checkout@main
7379
- name: Output Docker info
@@ -138,6 +144,10 @@ jobs:
138144
max_attempts: 3
139145
command: |
140146
NAME=${IMAGE_REGISTRY} VERSION=${BRANCH} BUILD_DATE=${BUILD_DATE} TEST_EXISTING_KEDA=${TEST_EXISTING_KEDA} make chart_test_autoscaling_${{ matrix.test-strategy }}
147+
- name: Test chart upgrade
148+
if: (matrix.test-upgrade == true)
149+
run: |
150+
NAME=${IMAGE_REGISTRY} VERSION=${BRANCH} BUILD_DATE=${BUILD_DATE} TEST_EXISTING_KEDA=${TEST_EXISTING_KEDA} SET_MAX_REPLICAS=10 TEST_UPGRADE_CHART=${TEST_UPGRADE_CHART} make chart_test_autoscaling_${{ matrix.test-strategy }}
141151
- name: Cleanup Kubernetes cluster
142152
if: always()
143153
run: CLUSTER=${CLUSTER} make chart_cluster_cleanup

Diff for: charts/selenium-grid/templates/chrome-node-hpa.yaml

-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ metadata:
55
name: {{ template "seleniumGrid.chromeNode.fullname" . }}
66
namespace: {{ .Release.Namespace }}
77
annotations:
8-
helm.sh/resource-policy: delete
98
{{- with .Values.autoscaling.annotations }}
109
{{- toYaml . | nindent 4 }}
1110
{{- end }}

Diff for: charts/selenium-grid/templates/edge-node-hpa.yaml

-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ metadata:
55
name: {{ template "seleniumGrid.edgeNode.fullname" . }}
66
namespace: {{ .Release.Namespace }}
77
annotations:
8-
helm.sh/resource-policy: delete
98
{{- with .Values.autoscaling.annotations }}
109
{{- toYaml . | nindent 4 }}
1110
{{- end }}

Diff for: charts/selenium-grid/templates/firefox-node-hpa.yaml

-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ metadata:
55
name: {{ template "seleniumGrid.firefoxNode.fullname" . }}
66
namespace: {{ .Release.Namespace }}
77
annotations:
8-
helm.sh/resource-policy: delete
98
{{- with .Values.autoscaling.annotations }}
109
{{- toYaml . | nindent 4 }}
1110
{{- end }}

Diff for: charts/selenium-grid/values.yaml

+5-5
Original file line numberDiff line numberDiff line change
@@ -546,7 +546,7 @@ autoscaling:
546546
scalingType: job
547547
# Annotations for KEDA resources: ScaledObject and ScaledJob
548548
annotations:
549-
"helm.sh/hook": post-install,post-upgrade,post-rollback
549+
"helm.sh/hook": post-install
550550
# Options for KEDA scaled resources (keep only common options used for both ScaledJob and ScaledObject)
551551
scaledOptions:
552552
minReplicaCount: 0
@@ -1221,19 +1221,19 @@ prometheus-stack:
12211221
defaultRules:
12221222
create: true
12231223
annotations:
1224-
"helm.sh/hook": post-install,post-upgrade,post-rollback
1224+
"helm.sh/hook": post-install
12251225
alertmanager:
12261226
enabled: true
12271227
annotations:
1228-
"helm.sh/hook": post-install,post-upgrade,post-rollback
1228+
"helm.sh/hook": post-install
12291229
grafana:
12301230
enabled: true
12311231
adminPassword: admin
12321232
forceDeployDatasources: true
12331233
forceDeployDashboards: true
12341234
annotations:
1235-
"helm.sh/hook": post-install,post-upgrade,post-rollback
1235+
"helm.sh/hook": post-install
12361236
prometheus:
12371237
enabled: true
12381238
annotations:
1239-
"helm.sh/hook": post-install,post-upgrade,post-rollback
1239+
"helm.sh/hook": post-install

Diff for: tests/charts/make/chart_test.sh

+6
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ BASIC_AUTH_USERNAME=${BASIC_AUTH_USERNAME:-"sysAdminUser"}
3535
BASIC_AUTH_PASSWORD=${BASIC_AUTH_PASSWORD:-"myStrongPassword"}
3636
LOG_LEVEL=${LOG_LEVEL:-"INFO"}
3737
TEST_EXISTING_KEDA=${TEST_EXISTING_KEDA:-"true"}
38+
TEST_UPGRADE_CHART=${TEST_UPGRADE_CHART:-"false"}
3839

3940
cleanup() {
4041
# Get the list of pods
@@ -195,6 +196,11 @@ helm upgrade --install ${HELM_COMMAND_ARGS}
195196

196197
kubectl get pods -A
197198

199+
if [ "${TEST_UPGRADE_CHART}" = "true" ]; then
200+
echo "Focus on verify chart upgrade, skip Selenium tests"
201+
exit 0
202+
fi
203+
198204
echo "Run Tests"
199205
export CHART_CERT_PATH=$(readlink -f ${CHART_CERT_PATH})
200206
export SELENIUM_GRID_PROTOCOL=${SELENIUM_GRID_PROTOCOL}

0 commit comments

Comments
 (0)