Skip to content

Commit b988bc9

Browse files
authored
ingress-controller/ci: use asdf for kustomize (#1415)
## Summary Use `asdf` to manage the local `kustomize`. ## Related issues ## Checklist - [ ] reference any related issues - [ ] updated docs - [ ] updated unit tests - [ ] updated UPGRADING.md - [x] add appropriate tag (`improvement` / `bug` / etc) - [x] ready for review
1 parent d78135c commit b988bc9

4 files changed

Lines changed: 21 additions & 27 deletions

File tree

.github/workflows/test.yaml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,18 @@ jobs:
1515
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
1616
with:
1717
fetch-depth: 0
18+
19+
- name: Setup ASDF
20+
uses: asdf-vm/actions/install@b7bcd026f18772e44fe1026d729e1611cc435d47
21+
1822
- uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c
1923
with:
2024
go-version-file: .tool-versions
25+
2126
- uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405
2227
with:
2328
python-version: "3.x"
24-
- name: install kustomize
25-
run: make kustomize
29+
2630
- uses: pre-commit/action@2c7b3805fd2a0fd8c1884dcaebf91fc102a13ecd
2731
with:
2832
extra_args: --show-diff-on-failure --from-ref ${{

.tool-versions

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
golangci-lint 2.12.2
22
golang 1.26.3
33
nodejs 24.15.0
4+
kustomize 5.8.1

Makefile

Lines changed: 12 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -154,25 +154,25 @@ snapshot:
154154
##@ Deployment
155155

156156
.PHONY: install
157-
install: generated kustomize ## Install CRDs into the K8s cluster specified in ~/.kube/config.
157+
install: generated ## Install CRDs into the K8s cluster specified in ~/.kube/config.
158158
@echo "==> $@"
159-
@$(KUSTOMIZE) build config/crd | kubectl apply -f -
159+
@kustomize build config/crd | kubectl apply -f -
160160

161161
.PHONY: uninstall
162-
uninstall: generated kustomize ## Uninstall CRDs from the K8s cluster specified in ~/.kube/config.
162+
uninstall: generated ## Uninstall CRDs from the K8s cluster specified in ~/.kube/config.
163163
@echo "==> $@"
164-
@$(KUSTOMIZE) build config/crd | kubectl delete -f -
164+
@kustomize build config/crd | kubectl delete -f -
165165

166166
.PHONY: deploy
167-
deploy: generated kustomize ## Deploy controller to the K8s cluster specified in ~/.kube/config.
167+
deploy: generated ## Deploy controller to the K8s cluster specified in ~/.kube/config.
168168
@echo "==> $@"
169-
@cd config/manager && $(KUSTOMIZE) edit set image controller=${IMG}
170-
@$(KUSTOMIZE) build config/default | kubectl apply -f -
169+
@cd config/manager && kustomize edit set image controller=${IMG}
170+
@kustomize build config/default | kubectl apply -f -
171171

172172
.PHONY: undeploy
173173
undeploy: ## Undeploy controller from the K8s cluster specified in ~/.kube/config.
174174
@echo "==> $@"
175-
@$(KUSTOMIZE) build config/default | kubectl delete -f -
175+
@kustomize build config/default | kubectl delete -f -
176176

177177
## Location to install dependencies to
178178
LOCALBIN ?= $(shell pwd)/bin
@@ -190,23 +190,10 @@ clean:
190190
@chmod -Rf u+w internal/ui || true
191191
@rm -rf internal/ui
192192

193-
KUSTOMIZE ?= $(LOCALBIN)/kustomize
194-
195-
196-
KUSTOMIZE_INSTALL_SCRIPT ?= "https://raw.githubusercontent.com/kubernetes-sigs/kustomize/master/hack/install_kustomize.sh"
197-
.PHONY: kustomize
198-
kustomize: $(KUSTOMIZE) ## Download kustomize locally if necessary.
199-
@echo "==> $@"
200-
201-
$(KUSTOMIZE): $(LOCALBIN)
202-
@echo "==> $@"
203-
@rm -rf $(KUSTOMIZE)
204-
@curl -s $(KUSTOMIZE_INSTALL_SCRIPT) | bash -s -- $(subst v,,$(KUSTOMIZE_VERSION)) $(LOCALBIN)
205-
206193
.PHONY: deployment
207-
deployment: kustomize
194+
deployment:
208195
@echo "==> $@"
209-
@$(KUSTOMIZE) build config/default > deployment.yaml
196+
@kustomize build config/default > deployment.yaml
210197

211198
.PHONY: docs
212199
docs: generated
@@ -225,7 +212,7 @@ dev-install:
225212
@echo "deleting pods..."
226213
#@kubectl delete --force --selector app.kubernetes.io/name=pomerium pods || true
227214
@kubectl delete deployment/pomerium -n pomerium --wait || true
228-
@$(KUSTOMIZE) build config/dev/local --load-restrictor LoadRestrictionsNone | kubectl apply --filename -
215+
@kustomize build config/dev/local --load-restrictor LoadRestrictionsNone | kubectl apply --filename -
229216

230217
.PHONY: dev-logs
231218
dev-logs:
@@ -234,7 +221,7 @@ dev-logs:
234221
.PHONY: dev-gen-secrets
235222
dev-gen-secrets:
236223
@echo "==> $@"
237-
@$(KUSTOMIZE) build config/dev/gen_secrets | kubectl apply --filename -
224+
@kustomize build config/dev/gen_secrets | kubectl apply --filename -
238225

239226
.PHONY: dev-build
240227
dev-build:

scripts/update-dependencies

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ update-tools() {
3232
asdf set golang latest:1.26
3333
asdf install golangci-lint latest:2
3434
asdf set golangci-lint latest:2
35+
asdf install kustomize latest
36+
asdf set kustomize latest
3537

3638
popd
3739
}

0 commit comments

Comments
 (0)