From 6e2038736eabd665a47ea07a9391249029b334e6 Mon Sep 17 00:00:00 2001 From: desmax74 Date: Wed, 21 Jun 2023 14:31:23 +0200 Subject: [PATCH 1/3] [KOGITO-9428]Update Operator SDK Signed-off-by: desmax74 --- .github/workflows/checks.yml | 4 +-- 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 | 5 +-- hack/check-created-at-annotation.sh | 31 +++++++++++++++++++ hack/ci/install-operator-sdk.sh | 2 +- operator.yaml | 2 +- 10 files changed, 48 insertions(+), 16 deletions(-) create mode 100644 hack/check-created-at-annotation.sh diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index 628a8a702..52c633259 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -106,5 +106,5 @@ jobs: - name: Check generations 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) + chmod +x ${GITHUB_WORKSPACE}/hack/check-created-at-annotation.sh + ${GITHUB_WORKSPACE}/hack/check-created-at-annotation.sh diff --git a/Makefile b/Makefile index 2303a36f4..2ad38a69e 100644 --- a/Makefile +++ b/Makefile @@ -55,9 +55,9 @@ endif # Image URL to use all building/pushing image targets IMG ?= $(IMAGE_TAG_BASE):$(REDUCED_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.31.0 # Get the currently used golang install path (in GOPATH/bin, unless GOBIN is set) ifeq (,$(shell go env GOBIN)) @@ -132,7 +132,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 @@ -234,7 +234,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 @@ -265,7 +265,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 4cbe45a02..16be839c1 100644 --- a/bundle.Dockerfile +++ b/bundle.Dockerfile @@ -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=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.31.0 LABEL operators.operatorframework.io.metrics.mediatype.v1=metrics+v1 LABEL operators.operatorframework.io.metrics.project_layout=go.kubebuilder.io/v3 LABEL com.redhat.openshift.versions=v4.11 diff --git a/bundle/manifests/sonataflow-operator.clusterserviceversion.yaml b/bundle/manifests/sonataflow-operator.clusterserviceversion.yaml index 2fc42f029..7dbd9749b 100644 --- a/bundle/manifests/sonataflow-operator.clusterserviceversion.yaml +++ b/bundle/manifests/sonataflow-operator.clusterserviceversion.yaml @@ -99,7 +99,7 @@ metadata: containerImage: quay.io/kiegroup/kogito-serverless-operator-nightly:latest description: SonataFlow Kubernetes Operator for deploying workflow applications based on the CNCF Serverless Workflow specification - operators.operatorframework.io/builder: operator-sdk-v1.25.0 + operators.operatorframework.io/builder: operator-sdk-v1.31.0 operators.operatorframework.io/project_layout: go.kubebuilder.io/v3 repository: https://github.com/kiegroup/kogito-serverless-operator support: Red Hat @@ -417,7 +417,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 68eab166f..a66e9ac2c 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.31.0 operators.operatorframework.io.metrics.mediatype.v1: metrics+v1 operators.operatorframework.io.metrics.project_layout: go.kubebuilder.io/v3 com.redhat.openshift.versions: v4.11 diff --git a/config/default/manager_auth_proxy_patch.yaml b/config/default/manager_auth_proxy_patch.yaml index 96de46313..753d459b4 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 d5736b0a8..3f023fbb4 100644 --- a/docs/CONTRIBUTING.md +++ b/docs/CONTRIBUTING.md @@ -61,11 +61,12 @@ 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.31.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) - [CEKit 4.8.0+](https://cekit.io/) + GNU Make: Used to define composite build actions. This should be already installed or available as a package (https://www.gnu.org/software/make/). diff --git a/hack/check-created-at-annotation.sh b/hack/check-created-at-annotation.sh new file mode 100644 index 000000000..e310a72fd --- /dev/null +++ b/hack/check-created-at-annotation.sh @@ -0,0 +1,31 @@ +#!/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. + +# See https://github.com/operator-framework/operator-sdk/issues/6285 +# and https://github.com/operator-framework/operator-sdk/pull/6419 + +changed_files=$(git status -s) +check_file=$(expr "$changed_files" == "M bundle/manifests/sonataflow-operator.clusterserviceversion.yaml") + +if [[ "$check_file" == "0" ]] ; then + ##@TODO + check_lines=$(git diff HEAD --no-ext-diff --unified=0 --exit-code -a --no-prefix | grep "^\+") + var="+++ bundle/manifests/sonataflow-operator.clusterserviceversion.yaml + createdAt:" + if [[ $check_lines = $var* ]] ; then + changed_files='' + fi +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..def0f80e7 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.31.0 if [[ -z ${OPERATOR_SDK_VERSION} ]]; then OPERATOR_SDK_VERSION=$default_operator_sdk_version diff --git a/operator.yaml b/operator.yaml index 1e79c2e9a..235e632f1 100644 --- a/operator.yaml +++ b/operator.yaml @@ -3096,7 +3096,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 From 86b4957867c74f942d1197832c9e56bcb64a8c51 Mon Sep 17 00:00:00 2001 From: desmax74 Date: Wed, 2 Aug 2023 15:01:28 +0200 Subject: [PATCH 2/3] [KOGITO-9428]Update Operator SDK from 1.25 to 1.31 Signed-off-by: desmax74 --- hack/check-created-at-annotation.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/hack/check-created-at-annotation.sh b/hack/check-created-at-annotation.sh index e310a72fd..6a4d830ff 100644 --- a/hack/check-created-at-annotation.sh +++ b/hack/check-created-at-annotation.sh @@ -20,7 +20,6 @@ changed_files=$(git status -s) check_file=$(expr "$changed_files" == "M bundle/manifests/sonataflow-operator.clusterserviceversion.yaml") if [[ "$check_file" == "0" ]] ; then - ##@TODO check_lines=$(git diff HEAD --no-ext-diff --unified=0 --exit-code -a --no-prefix | grep "^\+") var="+++ bundle/manifests/sonataflow-operator.clusterserviceversion.yaml + createdAt:" if [[ $check_lines = $var* ]] ; then From 4671c09426dd448ca58a7f19f32222f5f10cffbd Mon Sep 17 00:00:00 2001 From: desmax74 Date: Wed, 30 Aug 2023 12:58:17 +0200 Subject: [PATCH 3/3] [Kogito-9428] Update Operator SDK from 1.25 to 1.31 Signed-off-by: desmax74 --- hack/check-created-at-annotation.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/hack/check-created-at-annotation.sh b/hack/check-created-at-annotation.sh index 6a4d830ff..1b24bebf0 100644 --- a/hack/check-created-at-annotation.sh +++ b/hack/check-created-at-annotation.sh @@ -15,6 +15,10 @@ # See https://github.com/operator-framework/operator-sdk/issues/6285 # and https://github.com/operator-framework/operator-sdk/pull/6419 +# Since createdAt field is always updated when make bundle is run +# we check if the bundle/manifests/sonataflow-operator.clusterserviceversion.yaml is modified with git +# and then we check if is the change involve only the createdAt, if yes we suppress the error on the Github Action +# this fix could be remove when the operator sdk provides a flag to avoid this change that broke the Github action checks changed_files=$(git status -s) check_file=$(expr "$changed_files" == "M bundle/manifests/sonataflow-operator.clusterserviceversion.yaml")