-
Notifications
You must be signed in to change notification settings - Fork 72
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
OADP-5245: Operator SDK update guidelines #1613
base: master
Are you sure you want to change the base?
OADP-5245: Operator SDK update guidelines #1613
Conversation
Signed-off-by: Mateus Oliveira <[email protected]>
Signed-off-by: Mateus Oliveira <[email protected]>
@mateusoliveira43: This pull request references OADP-5245 which is a valid jira issue. Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the task to target the "4.19.0" version, but no target version was set. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
This comment was marked as resolved.
This comment was marked as resolved.
Signed-off-by: Mateus Oliveira <[email protected]>
This comment was marked as resolved.
This comment was marked as resolved.
@mateusoliveira43: The following test failed, say
Full PR test history. Your PR dashboard. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
@@ -41,7 +41,7 @@ func isObjectOurs(scheme *runtime.Scheme, object client.Object) bool { | |||
return false | |||
} | |||
gvk := objGVKs[0] | |||
if gvk.Group == oadpv1alpha1.GroupVersion.Group && gvk.Version == oadpv1alpha1.GroupVersion.Version && gvk.Kind == oadpv1alpha1.Kind { | |||
if gvk.Group == oadpv1alpha1.GroupVersion.Group && gvk.Version == oadpv1alpha1.GroupVersion.Version && gvk.Kind == "DataProtectionApplication" { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this string not available somewhere as const/var already?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it was in api/
folder
since it was only referenced here, I removed it
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: kaovilai, mateusoliveira43 The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall changes look sane to me, except the dir changes for controllers
and main.go
. Also, just because we have some csv updates and refactoring I would test the PR on various OCP favors (ROSA, OCP-AWS etc), just to be cautious. Thank you @mateusoliveira43
@@ -1,4 +1,4 @@ | |||
package controllers |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMO controllers
(plural) is more apt that controller
(singular) as we have multiple controllers in our project.
Ref: https://sdk.operatorframework.io/docs/overview/project-layout/#golang
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this documentation is outdated
here is how a project scaffold with operator sdk version 1.34 looks like https://github.com/operator-framework/operator-sdk/tree/v1.34.x/testdata/go/v4/memcached-operator
it uses singular https://github.com/operator-framework/operator-sdk/blob/v1.34.x/testdata/go/v4/memcached-operator/internal/controller/memcached_controller.go#L17
changing this can break things
@@ -18,6 +18,7 @@ package main | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similarly IMO main.go
at root level seems more apt, I am unsure about moving it to cmd
Ref: https://sdk.operatorframework.io/docs/overview/project-layout/#golang
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is how it is generated in 1.34 https://github.com/operator-framework/operator-sdk/tree/v1.34.x/testdata/go/v4/memcached-operator/cmd
@@ -31,31 +47,21 @@ const ( | |||
oadpCloudStorageDeleteAnnotation = "oadp.openshift.io/cloudstorage-delete" | |||
) | |||
|
|||
// VeleroReconciler reconciles a Velero object | |||
type BucketReconciler struct { | |||
// CloudStorageReconciler reconciles a CloudStorage object |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
++ this always bugged me :)
@weshayutin please test install on rosa x86 and aws arm |
ROSA 4.17 x86_64 install and test: https://termbin.com/uq5x |
hrm.. @mateusoliveira43 arm install is hitting an issue. Not clear to me yet if it's the cluster or code changes. Issue is on
ARM is not yet built..
|
PR needs rebase. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
@weshayutin this error seems platform error (it was not built for ARM architecture) do you have the whole |
Why the changes were made
Fix #1540
Changes were made following documentation about how to upgrade Operator SDK version, from
1.23.0
to1.34.2
.Changes are necessary to allow creation of webhooks for NAC CRDs.
How to test the changes made
Run commands to confirm that after the changes they still work. For example
Read documentation about how to upgrade Operator SDK version and check if it is clear.