-
Notifications
You must be signed in to change notification settings - Fork 686
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
Upgrade to Kubebuilder v2 #1723
Conversation
This reverts commit e64f9c7.
👍 I think so too |
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.
LGTM!
Left some nits and questions but nothing to prevent a merge.
Created follow up issues for all the ones I know about, I'm sure we'll find more |
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.
🚀
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.
LGTM!
@@ -55,22 +54,22 @@ var ( | |||
// Add creates a new ApmServerElasticsearchAssociation Controller and adds it to the Manager with default RBAC. The Manager will set fields on the Controller | |||
// and Start it when the Manager is Started. | |||
func Add(mgr manager.Manager, params operator.Parameters) error { | |||
r := newReconciler(mgr, params) | |||
r := NewReconciler(mgr, params) |
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.
Any particular reason these need to be exported?
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.
I meant to leave a comment about that or fix it -- that was part of the change to using the new controller builder funcs that I later rolled back. Now there's not a good reason so I'll switch it back.
Jenkins test this please |
Summary
Related to #1188 and #1604
groupversion_info.go
rather than spread out over multiple files.check-fmt
during CI since controller-gen generates deepcopy files that do not match some newer versions, and enforcing it as part of CI is discouraged by the go team. I'll open a PR to fix it in controller-tools.InjectMapper()
to DynamicEnqueueRequest because it was introduced upstream in https://github.com/kubernetes-sigs/controller-runtime/pull/274/files+genclient
,+k8s:openapi-gen=true
, and+k8s:deepcopy-gen
Selector
everywhere. There were also some tests that were passing that should have been failing (and are now failing) because selectors were not applied to fake clients in the past.make ci
locally nothing modifies my gomod files.Differences from stock kubebuilder v2
cmd
pkg, but since we parse a lot of command line opts this is idiomatic for cobraOutstanding tasks
generate-crds
andgenerate-all-in-one
Notes
To compare to a base project I like to start up a new project to see how they scaffold it out
Migration guide: https://book.kubebuilder.io/migration/guide.html
Marker docs: https://book.kubebuilder.io/reference/markers.html