Skip to content

Commit

Permalink
Makefile silence failing version checks (#1458)
Browse files Browse the repository at this point in the history
If the respective binaries aren't available in '$PATH', this will no longer be printed out. Due to the way Makefiles work, this would have been printed even when using targets that don't depend on these version checks (e.g. when running 'make cli-fast').

Signed-off-by: Jan Schlicht <jan@d2iq.com>
  • Loading branch information
Jan Schlicht committed Apr 13, 2020
1 parent 50a43f4 commit 5c256ad
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ test-clean:

.PHONY: lint
lint:
ifneq (${GOLANGCI_LINT_VER}, "$(shell golangci-lint --version | cut -b 27-32)")
ifneq (${GOLANGCI_LINT_VER}, "$(shell golangci-lint --version 2>/dev/null | cut -b 27-32)")
./hack/install-golangcilint.sh
endif
golangci-lint run
Expand Down Expand Up @@ -95,8 +95,8 @@ deploy-clean:
.PHONY: generate
# Generate code
generate:
ifneq ($(shell go list -f '{{.Version}}' -m sigs.k8s.io/controller-tools), $(shell controller-gen --version | cut -b 10-))
@echo "(Re-)installing controller-gen. Current version: $(controller-gen --version | cut -b 10-). Need $(go list -f '{{.Version}}' -m sigs.k8s.io/controller-tools)"
ifneq ($(shell go list -f '{{.Version}}' -m sigs.k8s.io/controller-tools), $(shell controller-gen --version 2>/dev/null | cut -b 10-))
@echo "(Re-)installing controller-gen. Current version: $(controller-gen --version 2>/dev/null | cut -b 10-). Need $(go list -f '{{.Version}}' -m sigs.k8s.io/controller-tools)"
go get sigs.k8s.io/controller-tools/cmd/controller-gen@$$(go list -f '{{.Version}}' -m sigs.k8s.io/controller-tools)
endif
controller-gen crd paths=./pkg/apis/... output:crd:dir=config/crds output:stdout
Expand Down Expand Up @@ -148,7 +148,7 @@ docker-push:
.PHONY: imports
# used to update imports on project. NOT a linter.
imports:
ifneq (${GOLANGCI_LINT_VER}, "$(shell golangci-lint --version | cut -b 27-32)")
ifneq (${GOLANGCI_LINT_VER}, "$(shell golangci-lint --version 2>/dev/null | cut -b 27-32)")
./hack/install-golangcilint.sh
endif
golangci-lint run --disable-all -E goimports --fix
Expand Down

0 comments on commit 5c256ad

Please sign in to comment.