From 89f87597a250e112817e6e6aa1d2e7f14ff2a4c8 Mon Sep 17 00:00:00 2001 From: Fred Rolland Date: Tue, 3 Oct 2023 15:36:30 +0300 Subject: [PATCH] Makefile: fix operator-sdk target Signed-off-by: Fred Rolland --- Makefile | 25 ++++--------------------- 1 file changed, 4 insertions(+), 21 deletions(-) diff --git a/Makefile b/Makefile index e3e81b4e..cf10aa6f 100644 --- a/Makefile +++ b/Makefile @@ -270,10 +270,10 @@ kustomize: ## Download kustomize locally if necessary. $(call go-install-tool,$(KUSTOMIZE),sigs.k8s.io/kustomize/kustomize/v4@v4.5.5) .PHONY: operator-sdk -OPERATOR_SDK = ./bin/operator-sdk -operator-sdk: ## Download opm locally if necessary. +OPERATOR_SDK = $(TOOLSDIR)/operator-sdk +operator-sdk: ## Download operator-sdk locally if necessary. ifeq (,$(wildcard $(OPERATOR_SDK))) -ifeq (,$(shell which opm 2>/dev/null)) +ifeq (,$(shell which operator-sdk 2>/dev/null)) @{ \ set -e ;\ mkdir -p $(dir $(OPERATOR_SDK)) ;\ @@ -283,7 +283,7 @@ ifeq (,$(shell which opm 2>/dev/null)) chmod +x operator-sdk_$${OS}_$${ARCH} && mv operator-sdk_$${OS}_$${ARCH} ./bin/operator-sdk ;\ } else -OPM = $(shell which operator-sdk) +OPERATOR_SDK = $(shell which operator-sdk) endif endif @@ -309,23 +309,6 @@ release-build: cd hack && $(GO) run release.go --templateDir ./templates/crs/ --outputDir ../example/crs cd hack && $(GO) run release.go --templateDir ./templates/values/ --outputDir ../deployment/network-operator/ -.PHONY: opm -OPM = ./bin/opm -opm: ## Download opm locally if necessary. -ifeq (,$(wildcard $(OPM))) -ifeq (,$(shell which opm 2>/dev/null)) - @{ \ - set -e ;\ - mkdir -p $(dir $(OPM)) ;\ - OS=$(shell go env GOOS) && ARCH=$(shell go env GOARCH) && \ - curl -sSLo $(OPM) https://github.com/operator-framework/operator-registry/releases/download/v1.23.0/$${OS}-$${ARCH}-opm ;\ - chmod +x $(OPM) ;\ - } -else -OPM = $(shell which opm) -endif -endif - # go-install-tool will 'go install' any package $2 and install it to $1. define go-install-tool @[ -f $(1) ] || { \