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

Test Clients should increment generation on calls to replace when the .spec field has been modified. #431

Open
gavares opened this issue Jan 3, 2023 · 1 comment

Comments

@gavares
Copy link
Contributor

gavares commented Jan 3, 2023

TestResourceClient.replace currently has a check in place to increment the .metadata.resourceVersion version field but the .metadata.generation field is not incremented when there are changes to the .spec section of a CR. This leads to bad behavior while testing as certain patterns will compare generation and observedGeneration to determine if action should be taken.

According to discussions from the k8s dev team, generation:

  • should be incremented for all changes made to the .spec field of a CR.
  • should not be incremented if there are changes only to .metadata or .status

Looking at TestResourceClient.replace, .metadata.resourceVersion is being incremented and an additional check and increment should probably be added to .metadata.generation as well.

@gavares gavares changed the title Test Clients should increment generation on calls to replace Test Clients should increment generation on calls to replace when the .spec field has been modified. Jan 3, 2023
@vigoo
Copy link
Collaborator

vigoo commented Jan 3, 2023

Thanks for the report and the detailed information on how it should work!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants