-
Notifications
You must be signed in to change notification settings - Fork 84
feat: add observedGeneration to CommonStatus #414
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
feat: add observedGeneration to CommonStatus #414
Conversation
This updates the built in CommonStatus struct to provide observedGeneration behavior when using one of the provided status builders. Custom implementations of the BuildStatus interface could already set observedGeneration if desired, but this provides an opinionated default to the addon implementations.
Hi @sdowell. Thanks for your PR. I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. 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. |
/ok-to-test Thanks! I need to wrap my head around what happens for users who already define |
My understanding is that the intended pattern of using the Addon object structs (CommonStatus/CommonSpec) is to embed the addon struct(s) into your CRD struct. If a user upgrades to the new k-d-p version and already defined an observedGeneration field on their CRD, there would now be duplicate entries of observedGeneration on the struct. For example: type Status struct {
addonv1alpha1.CommonStatus `json:",inline"`
// +kubebuilder:default:=0
ObservedGeneration int64 `json:"observedGeneration"`
} My understanding is that it shouldn't encounter any build errors and the already defined field should take precedence for marshalling/unmarshalling. In this case I think the recommendation would be to replace the already defined field with the CommonStatus builtin to avoid confusion. And if they didn't already have an observedGeneration field on their struct, it would be added upon upgrading. |
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: sdowell, tomasaschan 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 |
This updates the built in CommonStatus struct to provide observedGeneration behavior when using one of the provided status builders. Custom implementations of the BuildStatus interface could already set observedGeneration if desired, but this provides an opinionated default to the addon implementations.
What this PR does / why we need it: Sets
status.observedGeneration
for the built-inCommonStatus
type. This makes it easier to determine when a KDP controller which uses the Addon object has reconciled the current spec of the managed resource.Which issue(s) this PR fixes:
Fixes #391