@@ -57,7 +57,8 @@ IMG ?= $(IMAGE):$(VERSION)
57
57
# Set the Operator SDK version to use.
58
58
# This is useful for CI or a project to utilize a specific version of the operator-sdk toolkit.
59
59
OPERATOR_SDK_VERSION ?= v1.35.0
60
-
60
+ # Set the path to Operator SDK - OPERATOR_SDK_VERSION will be ignored.
61
+ OPERATOR_SDK ?= bin/operator-sdk
61
62
62
63
# Get the currently used golang install path (in GOPATH/bin, unless GOBIN is set)
63
64
ifeq (,$(shell go env GOBIN) )
@@ -123,19 +124,6 @@ test-e2e: manifests generate fmt vet ## Run e2e tests.
123
124
test-metrics :
124
125
go test -timeout 30m ./test/e2e -ginkgo.focus=" Argo CD metrics controller" -coverprofile cover.out -ginkgo.v
125
126
126
- .PHONY : operator-sdk
127
- OPERATOR_SDK ?= $(LOCALBIN ) /operator-sdk
128
- operator-sdk : # # Download operator-sdk locally if necessary.
129
- ifeq (,$(wildcard $(OPERATOR_SDK ) ) )
130
- @{ \
131
- set -e ;\
132
- mkdir -p $(dir $(OPERATOR_SDK)) ;\
133
- OS=$(shell go env GOOS) && ARCH=$(shell go env GOARCH) && \
134
- curl -sSLo $(OPERATOR_SDK) https://github.com/operator-framework/operator-sdk/releases/download/$(OPERATOR_SDK_VERSION)/operator-sdk_$${OS}_$${ARCH} ;\
135
- chmod +x $(OPERATOR_SDK) ;\
136
- }
137
- endif
138
-
139
127
.PHONY : test-route
140
128
test-route :
141
129
go test -timeout 30m ./test/e2e -ginkgo.focus=" Argo CD ConsoleLink controller" -coverprofile cover.out -ginkgo.v
@@ -166,16 +154,16 @@ e2e-tests-sequential-ginkgo: ginkgo ## Runs kuttl e2e sequential tests
166
154
.PHONY : e2e-tests-parallel-ginkgo # # Runs kuttl e2e parallel tests, (Defaults to 5 runs at a time)
167
155
e2e-tests-parallel-ginkgo : ginkgo
168
156
@echo " Running GitOps Operator parallel Ginkgo E2E tests..."
169
- $(GINKGO_CLI ) -p -v -procs=5 --trace --timeout 30m -r ./test/openshift/e2e/ginkgo/parallel
157
+ $(GINKGO_CLI ) -p -v -procs=5 --trace --timeout 30m -r ./test/openshift/e2e/ginkgo/parallel
170
158
171
159
.PHONY : e2e-tests-sequential
172
- e2e-tests-sequential :
160
+ e2e-tests-sequential :
173
161
CI=prow make e2e-tests-sequential-ginkgo # # Runs kuttl e2e sequentail tests
174
162
# @echo "Running GitOps Operator sequential E2E tests..."
175
163
# . ./scripts/run-kuttl-tests.sh sequential
176
164
177
165
.PHONY : e2e-tests-parallel # # Runs kuttl e2e parallel tests, (Defaults to 5 runs at a time)
178
- e2e-tests-parallel :
166
+ e2e-tests-parallel :
179
167
CI=prow make e2e-tests-parallel-ginkgo
180
168
# @echo "Running GitOps Operator parallel E2E tests..."
181
169
# . ./scripts/run-kuttl-tests.sh parallel
@@ -188,12 +176,12 @@ e2e-non-olm-tests-sequential: ## Runs kuttl non-olm e2e sequentail tests
188
176
.PHONY : e2e-non-olm-tests-parallel # # Runs kuttl non-olm e2e parallel tests, (Defaults to 5 runs at a time)
189
177
e2e-non-olm-tests-parallel :
190
178
@echo " Running Non-OLM GitOps Operator parallel E2E tests..."
191
- . ./hack/scripts/run-non-olm-kuttl-test.sh -t parallel
179
+ . ./hack/scripts/run-non-olm-kuttl-test.sh -t parallel
192
180
193
181
.PHONY : e2e-non-olm-tests-all # # Runs kuttl non-olm e2e parallel tests, (Defaults to 5 runs at a time)
194
182
e2e-non-olm-tests-all :
195
183
@echo " Running Non-OLM GitOps Operator E2E tests..."
196
- . ./hack/scripts/run-non-olm-kuttl-test.sh -t all
184
+ . ./hack/scripts/run-non-olm-kuttl-test.sh -t all
197
185
198
186
# #@ Build
199
187
@@ -215,27 +203,17 @@ docker-push: ## Push docker image with the manager.
215
203
216
204
# #@ Build Dependencies
217
205
218
- # # Location to install dependencies to
219
- LOCALBIN ?= $(shell pwd) /bin
220
- $(LOCALBIN ) :
221
- mkdir -p $(LOCALBIN )
206
+ # Do not use OPERATOR_SDK variable not to overwrite the user provided path
207
+ bin/operator-sdk :
208
+ mkdir -p bin
209
+ curl -sSLo bin/operator-sdk \
210
+ https://github.com/operator-framework/operator-sdk/releases/download/$(OPERATOR_SDK_VERSION ) /operator-sdk_$(shell go env GOOS) _$(shell go env GOARCH)
211
+ chmod +x bin/operator-sdk
222
212
213
+ # Install to bin/operator-sdk unless already there or explicit OPERATOR_SDK provided
223
214
.PHONY : operator-sdk
224
- OPERATOR_SDK ?= $(LOCALBIN ) /operator-sdk
225
- operator-sdk : # # Download operator-sdk locally if necessary.
226
- ifeq (,$(wildcard $(OPERATOR_SDK ) ) )
227
- ifeq (,$(shell which operator-sdk 2>/dev/null) )
228
- @{ \
229
- set -e ;\
230
- mkdir -p $(dir $(OPERATOR_SDK)) ;\
231
- OS=$(shell go env GOOS) && ARCH=$(shell go env GOARCH) && \
232
- curl -sSLo $(OPERATOR_SDK) https://github.com/operator-framework/operator-sdk/releases/download/$(OPERATOR_SDK_VERSION)/operator-sdk_$${OS}_$${ARCH} ;\
233
- chmod +x $(OPERATOR_SDK) ;\
234
- }
235
- else
236
- OPERATOR_SDK = $(shell which operator-sdk)
237
- endif
238
- endif
215
+ operator-sdk : $(OPERATOR_SDK )
216
+ @$(OPERATOR_SDK ) version
239
217
240
218
ifndef ignore-not-found
241
219
ignore-not-found = false
0 commit comments