Skip to content

Commit

Permalink
Make sure correct version of operator-sdk is always used (#728)
Browse files Browse the repository at this point in the history
* Make sure the correct version of operator-sdk is always used

This PR installs operator-sdk to ./bin which makes sure
that always correct version of operator-sdk is used.

Signed-off-by: Pavol Loffay <[email protected]>

* Create dir

Signed-off-by: Pavol Loffay <[email protected]>

* Fix

Signed-off-by: Pavol Loffay <[email protected]>
  • Loading branch information
pavolloffay authored Feb 22, 2022
1 parent d4fe9bb commit 462c4a5
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 22 deletions.
4 changes: 0 additions & 4 deletions .github/workflows/continuous-integration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,6 @@ jobs:
- name: "install kustomize"
run: ./hack/install-kustomize.sh

- uses: jpkrohling/[email protected]
with:
operator-sdk-version: v1.17.0

- name: "basic checks"
run: make ci

Expand Down
4 changes: 0 additions & 4 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,6 @@ jobs:
- name: "install kustomize"
run: ./hack/install-kustomize.sh

- uses: jpkrohling/[email protected]
with:
operator-sdk-version: v1.17.0

- name: "generate release resources"
run: make release-artifacts IMG_PREFIX="ghcr.io/open-telemetry/opentelemetry-operator"

Expand Down
4 changes: 0 additions & 4 deletions .github/workflows/scorecard.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,5 @@ jobs:
- name: "wait until cluster is ready"
run: kubectl wait --timeout=5m --for=condition=available deployment/coredns -n kube-system

- uses: jpkrohling/[email protected]
with:
operator-sdk-version: v1.17.0

- name: "run scorecard test"
run: make scorecard-tests
17 changes: 7 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ endif
KUBE_VERSION ?= 1.21
KIND_CONFIG ?= kind-$(KUBE_VERSION).yaml

OPERATOR_SDK_VERSION ?= 1.17.0

CERTMANAGER_VERSION ?= 1.6.1

ifndef ignore-not-found
Expand Down Expand Up @@ -152,7 +154,7 @@ prepare-e2e: kuttl set-test-image-vars set-image-controller container start-kind
$(KUSTOMIZE) build config/crd -o tests/_build/crds/

.PHONY: scorecard-tests
scorecard-tests:
scorecard-tests: operator-sdk
$(OPERATOR_SDK) scorecard -w=5m bundle || (echo "scorecard test failed" && exit 1)

.PHONY: set-test-image-vars
Expand Down Expand Up @@ -263,20 +265,15 @@ else
KIND=$(shell which kind)
endif

OPERATOR_SDK = $(shell pwd)/bin/operator-sdk
.PHONY: operator-sdk
operator-sdk:
ifeq (, $(shell which operator-sdk))
@{ \
set -e ;\
echo "" ;\
echo "ERROR: operator-sdk not found." ;\
echo "Please check https://sdk.operatorframework.io for installation instructions and try again." ;\
echo "" ;\
exit 1 ;\
[ -d bin ] || mkdir bin ;\
curl -L -o $(OPERATOR_SDK) https://github.com/operator-framework/operator-sdk/releases/download/v${OPERATOR_SDK_VERSION}/operator-sdk_`go env GOOS`_`go env GOARCH`;\
chmod +x $(OPERATOR_SDK) ;\
}
else
OPERATOR_SDK=$(shell which operator-sdk)
endif

# Generate bundle manifests and metadata, then validate generated files.
.PHONY: bundle
Expand Down

0 comments on commit 462c4a5

Please sign in to comment.