Skip to content

Commit

Permalink
Download kustomize with curl
Browse files Browse the repository at this point in the history
  • Loading branch information
zoetrope committed Mar 24, 2021
1 parent fae40e1 commit 05f3a3e
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ KUSTOMIZE_VERSION = 3.8.7
# Set the shell used to bash for better error handling.
SHELL = /bin/bash
.SHELLFLAGS = -e -o pipefail -c
BIN_DIR = $(shell pwd)/bin

# Get the currently used golang install path (in GOPATH/bin, unless GOBIN is set)
ifeq (,$(shell go env GOBIN))
Expand Down Expand Up @@ -67,22 +68,23 @@ test: manifests generate ## Run tests.
build: ## Build binary.
CGO_ENABLED=0 go build -o bin/pod-security-admission -ldflags="-w -s" main.go

CONTROLLER_GEN = $(shell pwd)/bin/controller-gen
CONTROLLER_GEN = $(BIN_DIR)/controller-gen
.PHONY: controller-gen
controller-gen: ## Download controller-gen locally if necessary.
$(call go-install-tool,$(CONTROLLER_GEN),sigs.k8s.io/controller-tools/cmd/controller-gen@v$(CONTROLLER_TOOLS_VERSION))

KUSTOMIZE = $(shell pwd)/bin/kustomize
KUSTOMIZE = $(BIN_DIR)/kustomize
.PHONY: kustomize
kustomize: ## Download kustomize locally if necessary.
$(call go-install-tool,$(KUSTOMIZE),sigs.k8s.io/kustomize/kustomize/v3@v$(KUSTOMIZE_VERSION))
mkdir -p $(BIN_DIR)
curl -sSLf https://github.com/kubernetes-sigs/kustomize/releases/download/kustomize%2Fv$(KUSTOMIZE_VERSION)/kustomize_v$(KUSTOMIZE_VERSION)_linux_amd64.tar.gz | tar -xz -C $(BIN_DIR)

STATICCHECK = $(shell pwd)/bin/staticcheck
STATICCHECK = $(BIN_DIR)/staticcheck
.PHONY: staticcheck
staticcheck:
$(call go-install-tool,$(STATICCHECK),honnef.co/go/tools/cmd/staticcheck@latest)

NILERR = $(shell pwd)/bin/nilerr
NILERR = $(BIN_DIR)/nilerr
.PHONY: nilerr
nilerr:
$(call go-install-tool,$(NILERR),github.com/gostaticanalysis/nilerr/cmd/nilerr@latest)
Expand Down

0 comments on commit 05f3a3e

Please sign in to comment.