Open mateusoliveira43 opened 1 month ago
diff -ruN current new > operator-sdk-upgrade.diff patch -p1 --verbose -d ./ -i operator-sdk-upgrade.diff
This is a blind patch albeit still better than before.
The full steps for each new operator-sdk upgrade is already outlined in docs at https://sdk.operatorframework.io/docs/upgrading-sdk-version/
The intent by operator-sdk authors per my understanding is for you to follow every step there.
For example, when upgrading to https://sdk.operatorframework.io/docs/upgrading-sdk-version/v1.34.0/ you are expected to make changes to your makefile.
Problem
Currently, we do not have any strategy to update
operator-sdk
version used by the project. Last time we updated it, for example, was to fix problem fixed in newer releases. Reference https://github.com/openshift/oadp-operator/pull/1398But we only updated the executable version, without any updates to project structure, which can cause
operator-sdk
commands and functionalities not work properly.Currently, some of
operator-sdk
functionalities are broken in the project.Example
These lines are wrong, pointing to an object that does not exist (
buckets.oadp.openshift.io
) https://github.com/openshift/oadp-operator/blob/5b0b9fcbc0d86c09158f9a6bcf9ec47fd61ae50e/controllers/bucket_controller.go#L44-L47If we update it and run
make bundle
,config/rbac/role.yaml
is not updated.https://github.com/openshift/oadp-operator/blob/5b0b9fcbc0d86c09158f9a6bcf9ec47fd61ae50e/config/rbac/role.yaml#L51
Solution
As proposed previously in https://github.com/openshift/oadp-operator/pull/1250 and already being applied in NAC project (references https://github.com/migtools/oadp-non-admin/blob/master/docs/CONTRIBUTING.md#upgrade-kubebuilder-version https://github.com/migtools/oadp-non-admin/blob/master/docs/architecture.md#kubebuilde), we should update all necessary places when updating
operator-sdk
version.To avoid human mistakes of forgetting to apply a change describe in
operator-sdk
documentation, we should do this update following these instructions:Download both current and new version of
operator-sdk
from https://github.com/operator-framework/operator-sdk/releases and runPros
operator-sdk
commands or functionalitiesdocker
andpodman
in Makefile)Cons