Closed rohitagarwal003 closed 2 years ago
Hi @rohitagarwal003. 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 /ok-to-test
on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.
Once the patch is verified, the new status will be reflected by the ok-to-test
label.
I understand the commands that are listed here.
/assign @mortent
/ok-to-test
Is this problem actually specific to DaemonSet?
Don't most built-in controllers use metadata.generation
and status.observedGeneration
?
Is this problem actually specific to DaemonSet? Don't most built-in controllers use metadata.generation and status.observedGeneration?
Very likely. I only experimented using this library against DaemonSet at the moment. Would you mind if I update other types in follow up PRs?
Ping. Let me know how you want to proceed. I can also update the PR to update all resources in this PR if that's preferred.
I think we will want a more generic solution, but I don't know the set of resources that have controllers than specify status.observedGeneration
. It's probably not 100%. So we might need to start with a list of resources we know do use it. Is that something you can compile? It's ok if it's not complete. We can always add more later. but I suspect the list includes many of the core resources and probably common extended ones too.
I think many of the commonly used built-in resource types do have observedGeneration
(in particular Deployment
and StatefulSet
), but we can't assume that all types have it. We should add this check to the ones we know follow this pattern, but I'm ok adding that in follow-up PRs.
The longer-term solution here could be to use the openAPI to check if a resource has the status.observedGeneration
property, but that would be a bigger change. I'm also not sure if we want to go down this path.
/approve
Thanks @karlkfi, @mortent.
I will work on a follow-up PR. Can you also LGTM this in the meantime. Thanks!
[APPROVALNOTIFIER] This PR is APPROVED
This pull-request has been approved by: mortent, rohitagarwal003, seans3
The full list of commands accepted by this bot can be found here.
The pull request process is described here
/retest
In status.Compute() -> checkGenericProperties() -> checkGeneration(), we check that metadata.generation is equal to status.observedGeneration but don't return an InProgress status if either of them is unset.
This may be reasonable for generic resource where we are unsure if these fields would be set, but for daemonsets, we know that these fields get set by the controller and so we should ensure that.
This fixes #548.