Skip to content

Commit 5a8a2ed

Browse files
committed
add operator-sdk binary installation to makefile
Signed-off-by: Soule BA <[email protected]>
1 parent 499f950 commit 5a8a2ed

File tree

5 files changed

+11
-5
lines changed

5 files changed

+11
-5
lines changed

.github/workflows/e2e-olm.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: e2e-oerator-lifecycle-manager
1+
name: e2e-olm
22

33
on:
44
workflow_dispatch:

Makefile

+8-1
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ opm-index:
156156
./config/operatorhub/flux-operator/scripts/opm-index.sh ${FLUX_OPERATOR_VERSION}
157157

158158
.PHONY: test-olm
159-
test-olm: opm-index
159+
test-olm: operator-sdk opm-index
160160
yq e -i ".spec.startingCSV=\"flux-operator.${FLUX_OPERATOR_VERSION}\"" \
161161
./config/operatorhub/flux-operator/testdata/004-operator-subscription.yaml
162162
yq e -i ".spec.image=\"ghcr.io/controlplaneio-fluxcd/openshift-flux-operator-index:${FLUX_OPERATOR_VERSION}\"" \
@@ -186,12 +186,19 @@ KUSTOMIZE ?= $(LOCALBIN)/kustomize-$(KUSTOMIZE_VERSION)
186186
CONTROLLER_GEN ?= $(LOCALBIN)/controller-gen-$(CONTROLLER_TOOLS_VERSION)
187187
ENVTEST ?= $(LOCALBIN)/setup-envtest-$(ENVTEST_VERSION)
188188
GOLANGCI_LINT = $(LOCALBIN)/golangci-lint-$(GOLANGCI_LINT_VERSION)
189+
OPERATOR_SDK ?= $(LOCALBIN)/operator-sdk
189190

190191
## Tool Versions
191192
KUSTOMIZE_VERSION ?= v5.4.1
192193
CONTROLLER_TOOLS_VERSION ?= v0.15.0
193194
ENVTEST_VERSION ?= release-0.18
194195
GOLANGCI_LINT_VERSION ?= v1.57.2
196+
OPERATOR_SDK_VERSION ?= v1.34.2
197+
198+
.PHONY: operator-sdk
199+
operator-sdk: $(OPERATOR_SDK) ## Download operator-sdk locally if necessary.
200+
$(OPERATOR_SDK): $(LOCALBIN)
201+
$(call go-install-tool,$(OPERATOR_SDK),github.com/operator-framework/operator-sdk/cmd/operator-sdk,$(OPERATOR_SDK_VERSION))
195202

196203
.PHONY: kustomize
197204
kustomize: $(KUSTOMIZE) ## Download kustomize locally if necessary.

config/operatorhub/flux-operator/scripts/opm-index.sh

-1
Original file line numberDiff line numberDiff line change
@@ -40,4 +40,3 @@ docker run --rm -it \
4040

4141
#push index
4242
docker push ghcr.io/controlplaneio-fluxcd/openshift-flux-operator-index:${VERSION}
43-

test/olm/e2e_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ var _ = BeforeSuite(func() {
4444
ExpectWithOffset(1, err).NotTo(HaveOccurred())
4545

4646
By("installing OLM")
47-
cmd := exec.Command("operator-sdk", "olm", "install", "--version", olmVersion)
47+
cmd := exec.Command("bin/operator-sdk", "olm", "install", "--version", olmVersion)
4848
_, err = utils.Run(cmd, "/test/olm")
4949
ExpectWithOffset(1, err).NotTo(HaveOccurred())
5050

test/olm/scorecard_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ var _ = Describe("Scorecard", Ordered, func() {
1212
Context("test", func() {
1313
It("should run successfully", func() {
1414
By("run scorecard tests")
15-
cmd := exec.Command("operator-sdk", "scorecard",
15+
cmd := exec.Command("bin/operator-sdk", "scorecard",
1616
img, "-c", "config/operatorhub/flux-operator/"+version+"/tests/scorecard/config.yaml",
1717
"-w", "60s", "-o", "json")
1818
_, err := utils.Run(cmd, "/test/olm")

0 commit comments

Comments
 (0)