kubernetes-sigs / cluster-api

Home for Cluster API, a subproject of sig-cluster-lifecycle
https://cluster-api.sigs.k8s.io
Apache License 2.0
3.5k stars 1.3k forks source link

Add .status.observedGeneration to all objects #3078

Closed rudoi closed 4 years ago

rudoi commented 4 years ago

User Story

Many Kubernetes objects have an observedGeneration in the status that enables comparison against .metadata.generation. This is helpful for implementing other controllers against CAPI types that want to wait until changes are reconciled by the CAPI controllers before jumping in and doing their work.

Detailed Description

Add .status.observedGeneration and have each controller set this value from .metadata.generation at the end of reconciliation.

/kind feature

vincepri commented 4 years ago

/milestone v0.3.x /help /priority important-longterm /area api

k8s-ci-robot commented 4 years ago

@vincepri: This request has been marked as needing help from a contributor.

Please ensure the request meets the requirements listed here.

If this request no longer meets these requirements, the label can be removed by commenting with the /remove-help command.

In response to [this](https://github.com/kubernetes-sigs/cluster-api/issues/3078): >/milestone v0.3.x >/help >/priority important-longterm >/area api Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository.
randomvariable commented 4 years ago

CAPI conditions will have an ObservedGeneration field, so will need to be done as part of / prior to that work.

benmoss commented 4 years ago

/assign

benmoss commented 4 years ago

Hmm, this seems more nuanced than at first glance. What are the semantics of when it is updated? Only when a reconciliation is "complete"/"successful"?

benmoss commented 4 years ago

And do we want to do this for every object? KubeadmConfigTemplate?

fabriziopandini commented 4 years ago

being the generation number linked to changes to the object's spec, IMO we should add the field to any object that allows spec mutation

vincepri commented 4 years ago

Templates don't have a status subresource today

benmoss commented 4 years ago

/reopen

We need to add the code to start updating ObservedGeneration once #3118 has merged using the new WithStatusObservedGeneration option there.

k8s-ci-robot commented 4 years ago

@benmoss: Reopened this issue.

In response to [this](https://github.com/kubernetes-sigs/cluster-api/issues/3078#issuecomment-639072861): >/reopen > >We need to add the code to start updating `ObservedGeneration` once #3118 has merged using the new `WithStatusObservedGeneration` option there. Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository.
vincepri commented 4 years ago

/milestone v0.3.7

vincepri commented 4 years ago

/priority important-soon

spagno commented 4 years ago

/assign /lifecycle active