From 1ce0adaaf1496275937c31de32f347f50e57ca7b Mon Sep 17 00:00:00 2001 From: desmax74 Date: Wed, 21 Jun 2023 14:31:23 +0200 Subject: [PATCH] [KOGITO-9428]Update Operator SDK Signed-off-by: desmax74 --- .github/workflows/checks.yml | 7 ++++- Makefile | 10 +++---- bundle.Dockerfile | 2 +- ...taflow-operator.clusterserviceversion.yaml | 4 +-- bundle/metadata/annotations.yaml | 2 +- config/default/manager_auth_proxy_patch.yaml | 2 +- docs/CONTRIBUTING.md | 4 +-- hack/checkCreatedAtAnnotation.sh | 29 +++++++++++++++++++ hack/ci/install-operator-sdk.sh | 2 +- operator.yaml | 2 +- 10 files changed, 49 insertions(+), 15 deletions(-) create mode 100644 hack/checkCreatedAtAnnotation.sh diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index 628a8a702..4cbd21baa 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -107,4 +107,9 @@ jobs: run: | make generate-all changed_files=$(git status -s) - [[ -z "$changed_files" ]] || (printf "Generation has not been done on this PR. See modified files: \n$changed_files\n Did you run 'make generate-all' before sending the PR" && exit 1) + ["$changed_files" == "M bundle/manifests/sonataflow-operator.clusterserviceversion.yaml"] ; then + printf "clusterserviceversion.yaml with createdAt" + else + printf "clusterserviceversion.yaml with createdAt 2" + [[ -z "$changed_files" ]] || (printf "Generation has not been done on this PR. See modified files: \n$changed_files\n Did you run 'make generate-all' before sending the PR" && exit 1) + fi diff --git a/Makefile b/Makefile index fae54ac42..8e644031e 100644 --- a/Makefile +++ b/Makefile @@ -52,9 +52,9 @@ endif # Image URL to use all building/pushing image targets IMG ?= $(IMAGE_TAG_BASE):$(VERSION) # ENVTEST_K8S_VERSION refers to the version of kubebuilder assets to be downloaded by envtest binary. -ENVTEST_K8S_VERSION = 1.24 +ENVTEST_K8S_VERSION = 1.26 -OPERATOR_SDK_VERSION ?= 1.25.0 +OPERATOR_SDK_VERSION ?= 1.29.0 # Get the currently used golang install path (in GOPATH/bin, unless GOBIN is set) ifeq (,$(shell go env GOBIN)) @@ -129,7 +129,7 @@ test-workflowproj: ##@ Build .PHONY: build -build: generate ## Build manager binary. +build: manifests generate fmt vet ## Build manager binary. go build -o bin/manager main.go .PHONY: build-4-debug @@ -231,7 +231,7 @@ ENVTEST ?= $(LOCALBIN)/setup-envtest ## Tool Versions KUSTOMIZE_VERSION ?= v4.5.2 -CONTROLLER_TOOLS_VERSION ?= v0.9.2 +CONTROLLER_TOOLS_VERSION ?= v0.11.3 KUSTOMIZE_INSTALL_SCRIPT ?= "https://raw.githubusercontent.com/kubernetes-sigs/kustomize/master/hack/install_kustomize.sh" .PHONY: kustomize @@ -262,7 +262,7 @@ bundle-build: ## Build the bundle image. .PHONY: bundle-push bundle-push: ## Push the bundle image. - $(MAKE) contianer-push IMG=$(BUNDLE_IMG) + $(MAKE) container-push IMG=$(BUNDLE_IMG) .PHONY: opm OPM = ./bin/opm diff --git a/bundle.Dockerfile b/bundle.Dockerfile index 8375a7fc8..a0afe7215 100644 --- a/bundle.Dockerfile +++ b/bundle.Dockerfile @@ -20,7 +20,7 @@ LABEL operators.operatorframework.io.bundle.manifests.v1=manifests/ LABEL operators.operatorframework.io.bundle.metadata.v1=metadata/ LABEL operators.operatorframework.io.bundle.package.v1=sonataflow-operator LABEL operators.operatorframework.io.bundle.channels.v1=alpha -LABEL operators.operatorframework.io.metrics.builder=operator-sdk-v1.25.0 +LABEL operators.operatorframework.io.metrics.builder=operator-sdk-v1.29.0 LABEL operators.operatorframework.io.metrics.mediatype.v1=metrics+v1 LABEL operators.operatorframework.io.metrics.project_layout=go.kubebuilder.io/v3 diff --git a/bundle/manifests/sonataflow-operator.clusterserviceversion.yaml b/bundle/manifests/sonataflow-operator.clusterserviceversion.yaml index 51bf7f713..3609d55f5 100644 --- a/bundle/manifests/sonataflow-operator.clusterserviceversion.yaml +++ b/bundle/manifests/sonataflow-operator.clusterserviceversion.yaml @@ -93,7 +93,7 @@ metadata: } ] capabilities: Basic Install - operators.operatorframework.io/builder: operator-sdk-v1.25.0 + operators.operatorframework.io/builder: operator-sdk-v1.29.0 operators.operatorframework.io/project_layout: go.kubebuilder.io/v3 name: sonataflow-operator.v2.0.0-snapshot namespace: placeholder @@ -404,7 +404,7 @@ spec: - --upstream=http://127.0.0.1:8080/ - --logtostderr=true - --v=0 - image: gcr.io/kubebuilder/kube-rbac-proxy:v0.13.0 + image: gcr.io/kubebuilder/kube-rbac-proxy:v0.13.1 name: kube-rbac-proxy ports: - containerPort: 8443 diff --git a/bundle/metadata/annotations.yaml b/bundle/metadata/annotations.yaml index 7a220108b..28442b382 100644 --- a/bundle/metadata/annotations.yaml +++ b/bundle/metadata/annotations.yaml @@ -5,7 +5,7 @@ annotations: operators.operatorframework.io.bundle.metadata.v1: metadata/ operators.operatorframework.io.bundle.package.v1: sonataflow-operator operators.operatorframework.io.bundle.channels.v1: alpha - operators.operatorframework.io.metrics.builder: operator-sdk-v1.25.0 + operators.operatorframework.io.metrics.builder: operator-sdk-v1.29.0 operators.operatorframework.io.metrics.mediatype.v1: metrics+v1 operators.operatorframework.io.metrics.project_layout: go.kubebuilder.io/v3 diff --git a/config/default/manager_auth_proxy_patch.yaml b/config/default/manager_auth_proxy_patch.yaml index da1a93fb6..9d239c9d7 100644 --- a/config/default/manager_auth_proxy_patch.yaml +++ b/config/default/manager_auth_proxy_patch.yaml @@ -10,7 +10,7 @@ spec: spec: containers: - name: kube-rbac-proxy - image: gcr.io/kubebuilder/kube-rbac-proxy:v0.13.0 + image: gcr.io/kubebuilder/kube-rbac-proxy:v0.13.1 args: - "--secure-listen-address=0.0.0.0:8443" - "--upstream=http://127.0.0.1:8080/" diff --git a/docs/CONTRIBUTING.md b/docs/CONTRIBUTING.md index 42aa9c97f..556856d5d 100644 --- a/docs/CONTRIBUTING.md +++ b/docs/CONTRIBUTING.md @@ -61,9 +61,9 @@ the [Kubebuilder Documentation](https://book.kubebuilder.io/introduction.html) In order to build the project, you need to comply with the following requirements: -- [operator-sdk-v1.25.0+](https://sdk.operatorframework.io/docs/building-operators/golang/installation/) +- [operator-sdk-v1.29.0+](https://sdk.operatorframework.io/docs/building-operators/golang/installation/) - [Go 1.19+](https://go.dev/dl/) -- [Kubebuilder 3.7.0+](https://github.com/kubernetes-sigs/kubebuilder/releases) +- [Kubebuilder 3.9.1+](https://github.com/kubernetes-sigs/kubebuilder/releases) GNU Make: Used to define composite build actions. This should be already installed or available as a diff --git a/hack/checkCreatedAtAnnotation.sh b/hack/checkCreatedAtAnnotation.sh new file mode 100644 index 000000000..1d5b907ff --- /dev/null +++ b/hack/checkCreatedAtAnnotation.sh @@ -0,0 +1,29 @@ +#!/bin/bash +# Copyright 2023 Red Hat, Inc. and/or its affiliates +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +changed_files=$(git status -s) +printf "$changed_files" +check_file=$(expr "$changed_files" == "M bundle/manifests/sonataflow-operator.clusterserviceversion.yaml") +echo "$check_file" + +if [[ "$check_file" == "0" ]] ; then + printf "Checking if the createdAt annotation has changed" + ##@TODO + changed_files='' + diff=$(git diff bundle/manifests/sonataflow-operator.clusterserviceversion.yaml) + echo $diff =="+ createdAt:" +else + [[ -z "$changed_files" ]] || (printf "Generation has not been done on this PR. See modified files: \n$changed_files\n Did you run 'make generate-all' before sending the PR" && exit 1) +fi \ No newline at end of file diff --git a/hack/ci/install-operator-sdk.sh b/hack/ci/install-operator-sdk.sh index 2d9e4054c..6bcc39ba7 100755 --- a/hack/ci/install-operator-sdk.sh +++ b/hack/ci/install-operator-sdk.sh @@ -14,7 +14,7 @@ # limitations under the License. set -e -default_operator_sdk_version=v1.25.0 +default_operator_sdk_version=v1.29.0 if [[ -z ${OPERATOR_SDK_VERSION} ]]; then OPERATOR_SDK_VERSION=$default_operator_sdk_version diff --git a/operator.yaml b/operator.yaml index d89cf90de..24ce5e4be 100644 --- a/operator.yaml +++ b/operator.yaml @@ -3144,7 +3144,7 @@ spec: - --upstream=http://127.0.0.1:8080/ - --logtostderr=true - --v=0 - image: gcr.io/kubebuilder/kube-rbac-proxy:v0.13.0 + image: gcr.io/kubebuilder/kube-rbac-proxy:v0.13.1 name: kube-rbac-proxy ports: - containerPort: 8443