Skip to content

Commit 9c90deb

Browse files
authored
chore: install helm with mise (#1439)
* chore: install helm with mise * chore: remove duplicated KIC CRDs from gateway-operator KIC subchart * chore: set helm version to 3.19.2 * chore: regenerate golden test files * chore: don't install kic CRD for KGO chart
1 parent d52dd0d commit 9c90deb

File tree

9 files changed

+130
-1103
lines changed

9 files changed

+130
-1103
lines changed

.github/workflows/release-pr.yaml

Lines changed: 17 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ env:
2121
# Specify this here because these tests rely on ktf to run kind for cluster creation.
2222
# renovate: datasource=github-releases depName=kubernetes-sigs/kind
2323
KIND_VERSION: "0.30.0"
24+
MISE_VERBOSE: 1
25+
MISE_DEBUG: 1
2426

2527
jobs:
2628
ensure-actions-sha-pin:
@@ -49,9 +51,6 @@ jobs:
4951
install: false
5052

5153
- name: Run linters
52-
env:
53-
MISE_VERBOSE: 1
54-
MISE_DEBUG: 1
5554
run: make lint
5655

5756
lint-test:
@@ -76,21 +75,20 @@ jobs:
7675
with:
7776
fetch-depth: 0
7877

79-
- name: Set up Helm
80-
uses: azure/setup-helm@1a275c3b69536ee54be43f2070a358922e12c8d4 # v4.3.1
81-
82-
- name: Add Helm repos
83-
run: |
84-
helm repo add bitnami https://charts.bitnami.com/bitnami
85-
helm repo add kong https://charts.konghq.com
86-
8778
- uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.0
8879
with:
8980
python-version: "3.11"
9081

82+
- uses: jdx/mise-action@146a28175021df8ca24f8ee1828cc2a60f980bd5 # v3.5.1
83+
9184
- name: Set up chart-testing
9285
uses: helm/chart-testing-action@6ec842c01de15ebb84c8627d2744a0c2f2755c9f # v2.8.0
9386

87+
- name: Add Helm repos
88+
run: |
89+
helm repo add bitnami https://charts.bitnami.com/bitnami
90+
helm repo add kong https://charts.konghq.com
91+
9492
- name: Run chart-testing (lint)
9593
run: ct lint --target-branch main --check-version-increment=false
9694

@@ -102,8 +100,13 @@ jobs:
102100

103101
- name: Run chart-testing (install)
104102
run: |
103+
helm version
105104
kubectl create ns kong-test
106-
ct install --target-branch main --charts charts/${{ matrix.chart-name}} --namespace kong-test
105+
ct install --target-branch main \
106+
--helm-extra-args "--wait" \
107+
--helm-extra-args "--timeout=3m" \
108+
--charts charts/${{ matrix.chart-name}} \
109+
--namespace kong-test
107110
# No need to delete the ns the cluster is scrapped after the job anyway.
108111
109112
integration-test:
@@ -143,8 +146,7 @@ jobs:
143146
- name: Checkout
144147
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
145148

146-
- name: setup helm
147-
uses: azure/setup-helm@1a275c3b69536ee54be43f2070a358922e12c8d4 # v4.3.1
149+
- uses: jdx/mise-action@146a28175021df8ca24f8ee1828cc2a60f980bd5 # v3.5.1
148150

149151
- name: setup testing environment (kind-cluster)
150152
env:
@@ -179,15 +181,11 @@ jobs:
179181
- name: checkout
180182
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
181183

182-
- name: setup helm
183-
uses: azure/setup-helm@1a275c3b69536ee54be43f2070a358922e12c8d4 # v4.3.1
184-
185184
- uses: jdx/mise-action@146a28175021df8ca24f8ee1828cc2a60f980bd5 # v3.5.1
186-
with:
187-
install: false
188185

189186
- name: build helm chart dependency
190187
run: |
188+
helm version
191189
helm repo add bitnami https://charts.bitnami.com/bitnami
192190
helm repo add kong https://charts.konghq.com
193191
helm dependency build charts/kong

.github/workflows/release-push.yaml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ on:
99
permissions:
1010
contents: read
1111

12+
env:
13+
MISE_VERBOSE: 1
14+
MISE_DEBUG: 1
15+
1216
jobs:
1317
release:
1418
timeout-minutes: 10
@@ -34,8 +38,8 @@ jobs:
3438
git config user.email "[email protected]"
3539
3640
# See https://github.com/helm/chart-releaser-action/issues/6
37-
- name: Set up Helm
38-
uses: azure/setup-helm@1a275c3b69536ee54be43f2070a358922e12c8d4 # v4.3.1
41+
42+
- uses: jdx/mise-action@146a28175021df8ca24f8ee1828cc2a60f980bd5 # v3.5.1
3943

4044
- name: Add dependency chart repos
4145
run: |

.mise.toml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
[tools."http:helm"]
2+
# renovate: datasource=github-releases depName=helm/helm
3+
version = "3.19.2"
4+
5+
[tools."http:helm".platforms]
6+
linux-x64 = { url = "https://get.helm.sh/helm-v{version}-linux-amd64.tar.gz" }
7+
linux-arm64 = { url = "https://get.helm.sh/helm-v{version}-linux-arm64.tar.gz" }
8+
macos-arm64 = { url = "https://get.helm.sh/helm-v{version}-darwin-arm64.tar.gz" }

Makefile

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ PROJECT_DIR := $(shell dirname $(abspath $(lastword $(MAKEFILE_LIST))))
22
TOOLS_VERSIONS_FILE = .tools_versions.yaml
33

44
MISE := $(shell which mise)
5+
MISE_FILE := .mise.toml
56
.PHONY: mise
67
mise:
78
@mise -V >/dev/null || (echo "mise - https://github.com/jdx/mise - not found. Please install it." && exit 1)
@@ -20,16 +21,16 @@ mise-install: mise
2021
@$(MISE) install -q $(DEP_VER)
2122

2223
KUBE_LINTER_VERSION = $(shell yq -ojson -r '.kube-linter' < $(TOOLS_VERSIONS_FILE))
23-
KUBE_LINTER = $(PROJECT_DIR)/bin/installs/kube-linter/v$(KUBE_LINTER_VERSION)/bin/kube-linter
24+
KUBE_LINTER = $(PROJECT_DIR)/bin/installs/kube-linter/$(KUBE_LINTER_VERSION)/bin/kube-linter
2425
.PHONY: kube-linter
2526
kube-linter: mise
2627
@$(MAKE) mise-plugin-install DEP=kube-linter
27-
@$(MAKE) mise-install DEP_VER=kube-linter@v$(KUBE_LINTER_VERSION)
28+
@$(MAKE) mise-install DEP_VER=kube-linter@$(KUBE_LINTER_VERSION)
2829

2930
CHARTSNAP_VERSION = $(shell yq -ojson -r '.chartsnap' < $(TOOLS_VERSIONS_FILE))
3031
.PHONY: chartsnap
31-
chartsnap:
32-
CHARTSNAP_VERSION=${CHARTSNAP_VERSION} ./scripts/install-chartsnap.sh
32+
chartsnap: download.helm
33+
HELM=$(HELM) CHARTSNAP_VERSION=${CHARTSNAP_VERSION} ./scripts/install-chartsnap.sh
3334

3435
SHELLCHECK_VERSION = $(shell yq -ojson -r '.shellcheck' < $(TOOLS_VERSIONS_FILE))
3536
SHELLCHECK = $(PROJECT_DIR)/bin/installs/shellcheck/$(SHELLCHECK_VERSION)/bin/shellcheck
@@ -45,6 +46,16 @@ download.actionlint: mise ## Download actionlint locally if necessary.
4546
@$(MISE) plugin install --yes -q actionlint
4647
@$(MISE) install -q actionlint@$(ACTIONLINT_VERSION)
4748

49+
HELM_VERSION = $(shell yq -p toml -o yaml '.tools["http:helm"].version' < $(MISE_FILE))
50+
HELM = $(PROJECT_DIR)/bin/installs/http-helm/$(HELM_VERSION)/helm
51+
.PHONY: download.helm
52+
download.helm: mise ## Download helm locally if necessary.
53+
@$(MAKE) mise-install DEP_VER=http:helm
54+
55+
.PHONY: print.helm
56+
print.helm: download.helm
57+
@echo "$(HELM)"
58+
4859
.PHONY: verify.diff
4960
verify.diff:
5061
@$(PROJECT_DIR)/scripts/verify-diff.sh $(PROJECT_DIR)
@@ -79,8 +90,8 @@ test.golden:
7990
(echo "$$GOLDEN_TEST_FAILURE_MSG" && exit 1)
8091

8192
.PHONY: test.golden.update
82-
test.golden.update:
83-
helm repo update kong
93+
test.golden.update: download.helm
94+
$(HELM) repo update kong
8495
@ $(MAKE) _chartsnap CHART=kong CHARTSNAP_ARGS="-u"
8596
@ $(MAKE) _chartsnap CHART=ingress CHARTSNAP_ARGS="-u"
8697
@ $(MAKE) _chartsnap CHART=gateway-operator CHARTSNAP_ARGS="-u"
@@ -94,7 +105,7 @@ export GOLDEN_TEST_FAILURE_MSG
94105

95106
.PHONY: _chartsnap
96107
_chartsnap: _chartsnap.deps
97-
helm chartsnap \
108+
$(HELM) chartsnap \
98109
-c ./charts/$(CHART) \
99110
-f ./charts/$(CHART)/ci/ \
100111
$(CHARTSNAP_ARGS) \
@@ -107,7 +118,7 @@ _chartsnap: _chartsnap.deps
107118
--api-versions admissionregistration.k8s.io/v1/ValidatingAdmissionPolicyBinding
108119

109120
.PHONY: _chartsnap.deps
110-
_chartsnap.deps: chartsnap
121+
_chartsnap.deps: download.helm chartsnap
111122
@ if [ "$(CHART)" = "kong" ]; then \
112-
helm dependencies update charts/ingress; \
123+
$(HELM) dependencies update charts/ingress; \
113124
fi

0 commit comments

Comments
 (0)