From 7153b5236d0d1ca765598d05c5c0690bdde49caf Mon Sep 17 00:00:00 2001
From: Pavol Loffay
Date: Mon, 21 Feb 2022 10:39:38 +0100
Subject: [PATCH 1/3] 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
---
.github/workflows/continuous-integration.yaml | 4 ----
.github/workflows/release.yaml | 4 ----
.github/workflows/scorecard.yaml | 4 ----
Makefile | 14 +++++---------
4 files changed, 5 insertions(+), 21 deletions(-)
diff --git a/.github/workflows/continuous-integration.yaml b/.github/workflows/continuous-integration.yaml
index 4d0dc98fbc..e5acb26f7c 100644
--- a/.github/workflows/continuous-integration.yaml
+++ b/.github/workflows/continuous-integration.yaml
@@ -25,10 +25,6 @@ jobs:
- name: "install kustomize"
run: ./hack/install-kustomize.sh
- - uses: jpkrohling/setup-operator-sdk@v1.1.0
- with:
- operator-sdk-version: v1.17.0
-
- name: "basic checks"
run: make ci
diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml
index 1293072869..f648bb2365 100644
--- a/.github/workflows/release.yaml
+++ b/.github/workflows/release.yaml
@@ -21,10 +21,6 @@ jobs:
- name: "install kustomize"
run: ./hack/install-kustomize.sh
- - uses: jpkrohling/setup-operator-sdk@v1.1.0
- with:
- operator-sdk-version: v1.17.0
-
- name: "generate release resources"
run: make release-artifacts IMG_PREFIX="ghcr.io/open-telemetry/opentelemetry-operator"
diff --git a/.github/workflows/scorecard.yaml b/.github/workflows/scorecard.yaml
index cefb8ac216..84ec971217 100644
--- a/.github/workflows/scorecard.yaml
+++ b/.github/workflows/scorecard.yaml
@@ -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/setup-operator-sdk@v1.1.0
- with:
- operator-sdk-version: v1.17.0
-
- name: "run scorecard test"
run: make scorecard-tests
diff --git a/Makefile b/Makefile
index b457120ce2..01054c9a7c 100644
--- a/Makefile
+++ b/Makefile
@@ -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
@@ -263,20 +265,14 @@ 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 ;\
+ 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
From 65da9dd24cbaf475cac9a36793c48a7405ee3f60 Mon Sep 17 00:00:00 2001
From: Pavol Loffay
Date: Mon, 21 Feb 2022 10:43:24 +0100
Subject: [PATCH 2/3] Create dir
Signed-off-by: Pavol Loffay
---
Makefile | 1 +
1 file changed, 1 insertion(+)
diff --git a/Makefile b/Makefile
index 01054c9a7c..a57ad39fbb 100644
--- a/Makefile
+++ b/Makefile
@@ -270,6 +270,7 @@ OPERATOR_SDK = $(shell pwd)/bin/operator-sdk
operator-sdk:
@{ \
set -e ;\
+ [ -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) ;\
}
From a8ba418e1ad3553cf990b5a8a473578edf7b440c Mon Sep 17 00:00:00 2001
From: Pavol Loffay
Date: Mon, 21 Feb 2022 10:45:39 +0100
Subject: [PATCH 3/3] Fix
Signed-off-by: Pavol Loffay
---
Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Makefile b/Makefile
index a57ad39fbb..91071f6f64 100644
--- a/Makefile
+++ b/Makefile
@@ -154,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