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

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

Open
grosser opened this issue Apr 25, 2024 · 6 comments
Open

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

grosser opened this issue Apr 25, 2024 · 6 comments
Labels
kind/feature Categorizes issue or PR as related to a new feature.

Comments

@grosser
Copy link
Contributor

grosser commented Apr 25, 2024

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:

  • conditions that do not change when going from "success" to "success" (i.e. updating an existing resource that was already propagated)
  • 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
@grosser grosser added the kind/feature Categorizes issue or PR as related to a new feature. label Apr 25, 2024
@XiShanYongYe-Chang
Copy link
Member

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
Copy link
Contributor Author

grosser commented Apr 26, 2024

Our usecase is:

  • pp exists to copy for example a cronjob to N member clusters
  • we update the cronjob in the host cluster
  • we want to know "was this change fully applied to all member clusters"

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
Copy link
Member

Thanks for your explanation.

Do you have any solution ideas?

@grosser
Copy link
Contributor Author

grosser commented Apr 28, 2024

put status.observedBoundResourceVersion on the binding

@XiShanYongYe-Chang
Copy link
Member

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
Copy link
Contributor Author

grosser commented Apr 29, 2024

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:

  • update deployment with a new label
  • check resourceversion, see it's 123
  • check binding, see it has observed 122
  • wait
  • check binding, see it has observed 123

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature Categorizes issue or PR as related to a new feature.
Projects
Status: No status
Development

No branches or pull requests

2 participants