Skip to content

Commit

Permalink
Update to operator-sdk 1.21 (#1094)
Browse files Browse the repository at this point in the history
Signed-off-by: Christoph Stäbler <[email protected]>
  • Loading branch information
creydr authored Jun 6, 2022
1 parent b61e03e commit 5ffbb92
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 6 deletions.
21 changes: 17 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ export SSH ?= ./cluster/ssh.sh
export KUBECTL ?= ./cluster/kubectl.sh

KUBECTL ?= ./cluster/kubectl.sh
OPERATOR_SDK ?= $(GOBIN)/operator-sdk
OPERATOR_SDK_VERSION ?= 1.21.0

GINKGO = GOFLAGS=-mod=mod go run github.com/onsi/ginkgo/v2/[email protected]
CONTROLLER_GEN = GOFLAGS=-mod=mod go run sigs.k8s.io/controller-tools/cmd/[email protected]
Expand Down Expand Up @@ -114,8 +114,20 @@ gofmt-check:
lint:
hack/lint.sh

$(OPERATOR_SDK):
curl https://github.com/operator-framework/operator-sdk/releases/download/v1.15.0/operator-sdk_linux_amd64 -o $(OPERATOR_SDK)
OPERATOR_SDK = $(CURDIR)/build/_output/bin/operator-sdk_${OPERATOR_SDK_VERSION}
operator-sdk: ## Download operator-sdk locally.
ifneq (,$(shell operator-sdk version 2>/dev/null | grep "operator-sdk version: \"v$(OPERATOR_SDK_VERSION)\"" ))
OPERATOR_SDK = $(shell which operator-sdk)
else
ifeq (,$(wildcard $(OPERATOR_SDK)))
@{ \
set -e ;\
mkdir -p $(dir $(OPERATOR_SDK)) ;\
curl -Lo $(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) ;\
}
endif
endif

gen-k8s:
cd api && $(CONTROLLER_GEN) object:headerFile="hack/boilerplate.go.txt" paths="./..."
Expand Down Expand Up @@ -200,7 +212,7 @@ vendor:
go mod vendor

# Generate bundle manifests and metadata, then validate generated files.
bundle: $(OPERATOR_SDK) gen-crds manifests
bundle: operator-sdk gen-crds manifests
cp -r deploy/bases $(MANIFESTS_DIR)/bases
$(OPERATOR_SDK) generate bundle -q --overwrite --version $(VERSION) $(BUNDLE_METADATA_OPTS) --deploy-dir $(MANIFESTS_DIR) --crds-dir deploy/crds
$(OPERATOR_SDK) bundle validate ./bundle
Expand Down Expand Up @@ -231,6 +243,7 @@ olm-push: bundle-push index-push
test/unit \
generate \
check-gen \
operator-sdk \
test-e2e-handler \
test-e2e-operator \
test-e2e \
Expand Down
2 changes: 1 addition & 1 deletion bundle.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ LABEL operators.operatorframework.io.bundle.manifests.v1=manifests/
LABEL operators.operatorframework.io.bundle.metadata.v1=metadata/
LABEL operators.operatorframework.io.bundle.package.v1=kubernetes-nmstate-operator
LABEL operators.operatorframework.io.bundle.channels.v1=alpha
LABEL operators.operatorframework.io.metrics.builder=operator-sdk-v1.13.0+git
LABEL operators.operatorframework.io.metrics.builder=operator-sdk-v1.21.0
LABEL operators.operatorframework.io.metrics.mediatype.v1=metrics+v1
LABEL operators.operatorframework.io.metrics.project_layout=go.kubebuilder.io/v3

Expand Down
2 changes: 1 addition & 1 deletion bundle/metadata/annotations.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ annotations:
operators.operatorframework.io.bundle.metadata.v1: metadata/
operators.operatorframework.io.bundle.package.v1: kubernetes-nmstate-operator
operators.operatorframework.io.bundle.channels.v1: alpha
operators.operatorframework.io.metrics.builder: operator-sdk-v1.13.0+git
operators.operatorframework.io.metrics.builder: operator-sdk-v1.21.0
operators.operatorframework.io.metrics.mediatype.v1: metrics+v1
operators.operatorframework.io.metrics.project_layout: go.kubebuilder.io/v3

Expand Down

0 comments on commit 5ffbb92

Please sign in to comment.