-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
kubebuilder/quickstart: add instruction for enabling status subresource #2897
kubebuilder/quickstart: add instruction for enabling status subresource #2897
Conversation
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
/approve
@asmacdo Any idea why the netlify checks might have failed?
Not sure how to rerun them if this is a flake. |
I saw this error occurs before. No idea too. |
@@ -109,6 +109,20 @@ type MemcachedStatus struct { | |||
} | |||
``` | |||
|
|||
Add the `+kubebuilder:subresource:status` [marker comment][status_marker] to enable the [status subresource][status_subresource] for the CRD so that the controller can update the CR status without changing the rest of the CR 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.
Nit: wording, comment is implied by marker.
Add the `+kubebuilder:subresource:status` [marker comment][status_marker] to enable the [status subresource][status_subresource] for the CRD so that the controller can update the CR status without changing the rest of the CR object: | |
Add the `+kubebuilder:subresource:status` [marker][status_marker] to add a [status subresource][status_subresource] to the CRD manifest so that the controller can update CR statuses efficiently: |
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.
Agree with the other nits but I'd still want to highlight exactly why we're enabling the status subresource rather than say efficiently
. That behavior is not obvious and it's better to be verbose about it.
Part of the reason why I had this error in the first place.
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.
One nit, otherwise
/lgtm
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
New changes are detected. LGTM label has been removed. |
Description of the change:
Add docs for enabling status subresource in the kubebuilder quickstart guide.
Motivation for the change:
Resolves the error I saw in #2827 (comment) where the controller failed to update the status subresource with the status writer client.
https://github.com/operator-framework/operator-sdk/blob/master/example/kb-memcached-operator/memcached_controller.go.tmpl#L114