Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[KOGITO-9428]Update Operator SDK from 1.25 to 1.31 #165

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
10 changes: 5 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lol


.PHONY: opm
OPM = ./bin/opm
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=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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
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: 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
Expand Down
2 changes: 1 addition & 1 deletion config/default/manager_auth_proxy_patch.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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/"
Expand Down
5 changes: 3 additions & 2 deletions docs/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -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/).
Expand Down
34 changes: 34 additions & 0 deletions hack/check-created-at-annotation.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#!/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
# 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")

if [[ "$check_file" == "0" ]] ; then
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that is the specific use case where only that file is changed right ?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you add a small comment on what it does ? (apart from the issues above)

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
2 changes: 1 addition & 1 deletion hack/ci/install-operator-sdk.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion operator.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down