Skip to content
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

Expose observedGeneration at status spec for CRD objects #1155

Open
f41gh7 opened this issue Nov 11, 2024 · 1 comment
Open

Expose observedGeneration at status spec for CRD objects #1155

f41gh7 opened this issue Nov 11, 2024 · 1 comment
Assignees
Labels
enhancement New feature or request

Comments

@f41gh7
Copy link
Collaborator

f41gh7 commented Nov 11, 2024

Currently CRDs have status and reason field which provide object state description. It will be great to also have observedGeneration field as Kubernetes does for core resources.

observedGeneration must be changed to the value of metadata.generation field at the time, when operator started to process reconcile event for CRD.

See this docs for details https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#typical-status-properties

@f41gh7 f41gh7 added the enhancement New feature or request label Nov 11, 2024
@f41gh7 f41gh7 self-assigned this Nov 19, 2024
f41gh7 added a commit that referenced this issue Nov 20, 2024
Previously, applications had different json tags for `updataStatus` fields.
clusterStatus for VMCluster for instance. Print fields for status pointed to the different fields.
There were unused fields at status definitions. Code was copy-pasted for status updates.

 This commit addresses this issue with the following changes:
* copy-pasted code replaced with generic implementation
* after status patch, operator updates object version. This must resolve issues with conflicts during status update requests.
* unused fields marked as deprecated an will be removed at upcoming releases
* now all app components uses the same field `updateStatus`, that holds information about current app state
* In addition new field `observedGeneration` was added, in the same way as it used at Kubernetes API. This change
 must help track CRD objects changes for 3rd party clients.

 Related issue:

#1155
Signed-off-by: f41gh7 <[email protected]>
f41gh7 added a commit that referenced this issue Nov 20, 2024
Previously, applications had different json tags for `updataStatus` fields.
clusterStatus for VMCluster for instance. Print fields for status pointed to the different fields.
There were unused fields at status definitions. Code was copy-pasted for status updates.

 This commit addresses this issue with the following changes:
* copy-pasted code replaced with generic implementation
* after status patch, operator updates object version. This must resolve issues with conflicts during status update requests.
* unused fields marked as deprecated an will be removed at upcoming releases
* now all app components uses the same field `updateStatus`, that holds information about current app state
* In addition new field `observedGeneration` was added, in the same way as it used at Kubernetes API. This change
 must help track CRD objects changes for 3rd party clients.

 Related issue:

#1155

Signed-off-by: f41gh7 <[email protected]>
@f41gh7 f41gh7 added the waiting for release The change was merged to upstream, but wasn't released yet. label Nov 20, 2024
@f41gh7
Copy link
Collaborator Author

f41gh7 commented Nov 25, 2024

Issue was partially fixed at v0.50.0 release

It's still required to add observedGeneration field to child objects, such as VMServiceScrape

@f41gh7 f41gh7 removed the waiting for release The change was merged to upstream, but wasn't released yet. label Nov 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant