karmada-io / karmada

Open, Multi-Cloud, Multi-Cluster Kubernetes Orchestration
https://karmada.io
Apache License 2.0
4.14k stars 811 forks source link

Need a way to tell if resourcebinding saw latest resource version #4871

Open grosser opened 3 weeks ago

grosser commented 3 weeks ago

What would you like to be added:

a way to tell if a resourcebinding has seen & verified the latest change to a resource for example status.observedBoundResourceVersion: 12345

Why is this needed:

I want to verify that the latest change was applied before proceeding with my script, but atm that involves having to load the resource from the target cluster and seeing if it has all changes applied and I'd love a generic solution

the resourcebinding has:

XiShanYongYe-Chang commented 3 weeks ago

Hi @grosser thanks~

I think this is interesting, but I don't understand some parts of the description in the issue.

but atm that involves having to load the resource from the target cluster

What does that mean?

seeing if it has all changes applied and I'd love a generic solution

I like the generic solution.

generation that does not change when updating updating a propagationpolicy with a noop change generation that does not change when updating updating a overridepolicy with a noop change

Do you have any examples that explain these two sentences?

grosser commented 3 weeks ago

Our usecase is:

So if we could check the revision in the host cluster and then check the bindings we could do that. Atm what we do is capture the generation of every binding, then do the update, then compare that the observedgeneration is higher that before.

XiShanYongYe-Chang commented 2 weeks ago

Thanks for your explanation.

Do you have any solution ideas?

grosser commented 2 weeks ago

put status.observedBoundResourceVersion on the binding

XiShanYongYe-Chang commented 2 weeks ago

What is the meaning of this field and what is the logic around it? Maybe you can initiate a proposal to promote the development of this feature.

grosser commented 2 weeks ago

meaning/logic: the ResourceVersion of the bound resource when it was observed/propagated

by storing that on the binding an observer can see if their changes are propagated

for example: