Skip to content

Commit

Permalink
chore(ci): install tooling to keep the same version
Browse files Browse the repository at this point in the history
Closes #5903
  • Loading branch information
squakez committed Nov 29, 2024
1 parent 309c627 commit 3909efe
Showing 1 changed file with 4 additions and 15 deletions.
19 changes: 4 additions & 15 deletions script/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ LAST_RELEASED_VERSION ?= 2.5.0
DEFAULT_RUNTIME_VERSION := 3.15.0
# Kubernetes tooling
CONTROLLER_GEN_VERSION := v0.15.0
CONTROLLER_GEN=$(GOBIN)/controller-gen
CODEGEN_VERSION := v0.30.6
OPERATOR_SDK_VERSION := v1.30.0
KUSTOMIZE_VERSION := v4.5.4
Expand Down Expand Up @@ -221,14 +222,15 @@ generate: codegen-tools-install
cd pkg/apis/camel && $(CONTROLLER_GEN) paths="./..." object
cd addons/keda/duck && $(CONTROLLER_GEN) paths="./..." object

codegen-tools-install: controller-gen
codegen-tools-install:
@# We must force the installation to make sure we are using the correct version
@# Note: as there is no --version in the tools, we cannot rely on cached local versions
@echo "Installing k8s.io/code-generator tools with version $(CODEGEN_VERSION)"
go install k8s.io/code-generator/cmd/applyconfiguration-gen@$(CODEGEN_VERSION)
go install k8s.io/code-generator/cmd/client-gen@$(CODEGEN_VERSION)
go install k8s.io/code-generator/cmd/lister-gen@$(CODEGEN_VERSION)
go install k8s.io/code-generator/cmd/informer-gen@$(CODEGEN_VERSION)
go install sigs.k8s.io/controller-tools/cmd/controller-gen@$(CONTROLLER_GEN_VERSION)

build: codegen build-resources test build-kamel build-compile-integration-tests

Expand Down Expand Up @@ -543,29 +545,16 @@ release-helm:
./script/release_helm.sh ${VERSION}

.PHONY: do-build build build-kamel build-kamel-platform build-resources dep codegen images images-push images-push-staging image-build test check clean release cross-compile package-examples set-version git-tag check-licenses build-resources release-helm release-staging release-nightly get-staging-repo get-version
.PHONY: controller-gen kubectl kustomize operator-sdk opm

# find or download controller-gen if necessary
controller-gen:
ifeq (, $(shell command -v controller-gen 2> /dev/null))
go install sigs.k8s.io/controller-tools/cmd/controller-gen@$(CONTROLLER_GEN_VERSION)
CONTROLLER_GEN=$(GOBIN)/controller-gen
else
CONTROLLER_GEN=$(shell command -v controller-gen 2> /dev/null)
endif
.PHONY: kubectl kustomize operator-sdk opm

kubectl:
ifeq (, $(shell command -v kubectl 2> /dev/null))
$(error "No kubectl found in PATH. Please install and re-run")
endif

kustomize:
ifeq (, $(shell command -v kustomize 2> /dev/null))
go install sigs.k8s.io/kustomize/kustomize/v4@$(KUSTOMIZE_VERSION)
KUSTOMIZE=$(GOBIN)/kustomize
else
KUSTOMIZE=$(shell command -v kustomize 2> /dev/null)
endif

operator-sdk: detect-os
@echo "####### Installing operator-sdk version $(OPERATOR_SDK_VERSION)..."
Expand Down

0 comments on commit 3909efe

Please sign in to comment.