Skip to content

Commit f03a32f

Browse files
committed
try fix helm unittest issues
1 parent 62604d9 commit f03a32f

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

Makefile

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -298,11 +298,18 @@ test-race: generate fmt vet manifests golang-tests-race
298298
test: generate fmt vet manifests golang-tests
299299

300300
# helm-tests will run helm chart unit tests
301+
# some evergreen machines have upgraded to Helm 4, which currently breaks installing the unittest plugin
302+
# see https://github.com/helm-unittest/helm-unittest/issues/777
301303
helm-tests:
302304
@echo "Running helm chart unit tests..."
303305
@if ! helm plugin list | grep -q unittest; then \
304306
echo "Installing helm-unittest plugin..."; \
305-
helm plugin install https://github.com/helm-unittest/helm-unittest; \
307+
HELM_MAJOR_VERSION=$$(helm version --short | grep -oE 'v[0-9]+' | sed 's/v//'); \
308+
if [ "$$HELM_MAJOR_VERSION" = "4" ]; then \
309+
helm plugin install https://github.com/helm-unittest/helm-unittest --verify=false; \
310+
else \
311+
helm plugin install https://github.com/helm-unittest/helm-unittest; \
312+
fi \
306313
fi
307314
helm unittest helm_chart --color
308315

0 commit comments

Comments
 (0)