Skip to content

Commit 87e89e8

Browse files
Merge pull request #288 from rhmdnd/fix-kustomize-for-go-1.18
Use go-install to fetch kustomize
2 parents 0f2228f + 236a66f commit 87e89e8

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@ Versioning](https://semver.org/spec/v2.0.0.html).
1616

1717
### Internal Changes
1818

19+
- Update `make kustomize` to use `go install` for installing kustomize v4. This
20+
is [necessary](https://github.com/openshift/file-integrity-operator/issues/287)
21+
for installing kustomize using golang 1.18.
22+
1923
## [0.1.30] - 2022-07-25
2024

2125
### Fixes

Makefile

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -208,18 +208,18 @@ controller-gen: ## Build controller-gen from what's in vendor.
208208

209209
KUSTOMIZE = $(shell pwd)/build/kustomize
210210
kustomize: ## Download kustomize locally if necessary.
211-
$(call go-get-tool,$(KUSTOMIZE),sigs.k8s.io/kustomize/kustomize/v3@v3.8.7)
211+
$(call go-install-tool,$(KUSTOMIZE),sigs.k8s.io/kustomize/kustomize/v4@v4)
212212

213-
# go-get-tool will 'go get' any package $2 and install it to $1.
213+
# go-install-tool will 'go install' any package $2 and install it to $1.
214214
PROJECT_DIR := $(shell dirname $(abspath $(lastword $(MAKEFILE_LIST))))
215-
define go-get-tool
215+
define go-install-tool
216216
@[ -f $(1) ] || { \
217217
set -e ;\
218218
TMP_DIR=$$(mktemp -d) ;\
219219
cd $$TMP_DIR ;\
220220
go mod init tmp ;\
221-
echo "Downloading $(2)" ;\
222-
GOBIN=$(PROJECT_DIR)/build go get $(2) ;\
221+
echo "Installing $(2)" ;\
222+
GOBIN=$(PROJECT_DIR)/build GOFLAGS=-mod=mod go install $(2) ;\
223223
rm -rf $$TMP_DIR ;\
224224
}
225225
endef

0 commit comments

Comments
 (0)