This is an automated email from the ASF dual-hosted git repository. tsato pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/camel-k.git
The following commit(s) were added to refs/heads/main by this push: new c9ce11cf1 Minor updates for bundle generation c9ce11cf1 is described below commit c9ce11cf14fc71841ba795cdcb563ee222cf719b Author: phantomjinx <p.g.richard...@phantomjinx.co.uk> AuthorDate: Wed Oct 12 13:02:44 2022 +0100 Minor updates for bundle generation * camel-k.clusterserviceversion.yaml * Change base CSV back to template values rather than specific version * Makefile * Tidies up controller-gen install and resulting variable use * Ensures kustomize is installed prior to executing bundle --- .../bases/camel-k.clusterserviceversion.yaml | 10 +++---- script/Makefile | 35 +++++++++++++++------- 2 files changed, 29 insertions(+), 16 deletions(-) diff --git a/config/manifests/bases/camel-k.clusterserviceversion.yaml b/config/manifests/bases/camel-k.clusterserviceversion.yaml index dc0b0a2a7..860e93e0d 100644 --- a/config/manifests/bases/camel-k.clusterserviceversion.yaml +++ b/config/manifests/bases/camel-k.clusterserviceversion.yaml @@ -22,8 +22,8 @@ metadata: capabilities: Full Lifecycle categories: Integration & Delivery certified: "false" - containerImage: docker.io/apache/camel-k:1.11.0-SNAPSHOT - createdAt: 2022-10-13T09:04:42Z + containerImage: docker.io/apache/camel-k:X.Y.Z-SNAPSHOT + createdAt: 2022-07-05T16:41:32Z description: Apache Camel K is a lightweight integration platform, born on Kubernetes, with serverless superpowers. operators.operatorframework.io/builder: operator-sdk-v1.16.0 @@ -31,7 +31,7 @@ metadata: operators.operatorframework.io/project_layout: go.kubebuilder.io/v2 repository: https://github.com/apache/camel-k support: Camel - name: camel-k.v1.11.0 + name: camel-k.vX.Y.Z namespace: placeholder spec: apiservicedefinitions: {} @@ -153,8 +153,8 @@ spec: minKubeVersion: 1.11.0 provider: name: The Apache Software Foundation - replaces: camel-k-operator.v1.10.1 + replaces: camel-k-operator.vX.Y.Z selector: matchLabels: name: camel-k-operator - version: 1.11.0 + version: X.Y.Z diff --git a/script/Makefile b/script/Makefile index 929ba67c3..63eae92d1 100644 --- a/script/Makefile +++ b/script/Makefile @@ -192,20 +192,18 @@ generate: codegen-tools-install ./script/gen_client.sh ./script/gen_crd.sh ./script/gen_doc.sh - cd pkg/apis/camel && $(shell go env GOPATH)/bin/controller-gen paths="./..." object - cd addons/keda/duck && $(shell go env GOPATH)/bin/controller-gen paths="./..." object - cd addons/strimzi/duck && $(shell go env GOPATH)/bin/controller-gen paths="./..." object + cd pkg/apis/camel && $(CONTROLLER_GEN) paths="./..." object + cd addons/keda/duck && $(CONTROLLER_GEN) paths="./..." object + cd addons/strimzi/duck && $(CONTROLLER_GEN) paths="./..." object ./script/gen_client_strimzi.sh -codegen-tools-install: +codegen-tools-install: controller-gen @# 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/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) - @echo "sigs.k8s.io/controller-tools/cmd/controller-gen with version $(CONTROLLER_GEN_VERSION)" - go install sigs.k8s.io/controller-tools/cmd/controller-gen@$(CONTROLLER_GEN_VERSION) build: build-resources test build-kamel build-compile-integration-tests build-submodules @@ -512,9 +510,24 @@ install-minikube: get-staging-repo: @echo $(or ${STAGING_RUNTIME_REPO},https://repository.apache.org/content/repositories/snapshots@id=apache-snapshots@snapshots) -.PHONY: do-build build build-kamel build-resources dep detect-os codegen images images-dev images-push images-push-staging test check test-integration clean release cross-compile package-examples set-version git-tag release-notes check-licenses generate-deepcopy generate-client generate-doc build-resources release-helm release-staging release-nightly get-staging-repo get-version build-submodules set-module-version bundle-kamelets generate-keda generate-strimzi -.PHONY: controller-gen kubectl kustomize operator-sdk -.PHONY: kubectl kustomize operator-sdk opm +.PHONY: do-build build build-kamel build-resources dep codegen images images-dev images-push images-push-staging test check test-integration clean release cross-compile package-examples set-version git-tag release-notes check-licenses generate-deepcopy generate-client generate-doc build-resources release-helm release-staging release-nightly get-staging-repo get-version build-submodules set-module-version bundle-kamelets generate-keda generate-strimzi +.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)) + @{ \ + set -e ;\ + CONTROLLER_GEN_TMP_DIR=$$(mktemp -d) ;\ + cd $$CONTROLLER_GEN_TMP_DIR ;\ + go mod init tmp ;\ + go get sigs.k8s.io/controller-tools/cmd/controller-gen@$(CONTROLLER_GEN_VERSION) ;\ + rm -rf $$CONTROLLER_GEN_TMP_DIR ;\ + } +CONTROLLER_GEN=$(GOBIN)/controller-gen +else +CONTROLLER_GEN=$(shell command -v controller-gen 2> /dev/null) +endif kubectl: ifeq (, $(shell command -v kubectl 2> /dev/null)) @@ -618,12 +631,12 @@ pre-bundle: @sed -i 's/^ name: .*.\(v.*\)/ name: $(CSV_NAME)/' $(CSV_PATH) @sed -i 's/^ displayName: .*/ displayName: $(CSV_DISPLAY_NAME)/' $(CSV_PATH) @sed -i 's/^ version: .*/ version: $(CSV_VERSION)/' $(CSV_PATH) - @if grep -q replaces config/manifests/bases/camel-k.clusterserviceversion.yaml; \ + @if grep -q replaces $(CSV_PATH); \ then sed -i 's/^ replaces: .*/ replaces: $(CSV_REPLACES)/' $(CSV_PATH); \ else sed -i '/ version: ${CSV_VERSION}/a \ \ replaces: $(CSV_REPLACES)' $(CSV_PATH); \ fi -bundle: set-version generate-crd $(BUNDLE_CAMEL_APIS) kustomize operator-sdk pre-bundle +bundle: set-version generate-crd kustomize operator-sdk pre-bundle $(BUNDLE_CAMEL_APIS) @# Display BUNDLE_METADATA_OPTS for debugging $(info BUNDLE_METADATA_OPTS=$(BUNDLE_METADATA_OPTS)) @# Sets the operator image to the preferred image:tag