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

Handle case where resource version doesn't change after update #292

Merged
merged 2 commits into from
Feb 24, 2025

Conversation

jveski
Copy link
Collaborator

@jveski jveski commented Feb 24, 2025

The builtin APIs are full of edge cases where SMD and even the client-go scheme are not capable of comparing two versions of an API object. A few examples are documented in integration tests: resource quantities, fieldRefs, etc.

Eno currently uses a combination of SMD's equality logic and the scheme. But it turns out that the client-go scheme doesn't support defaulting - that requires importing a scheme for kubernetes/kubernetes, which is... not ideal.

So this PR proposes a different approach: keep updating until the resource version doesn't change. This essentially outsources the equality logic to apiserver: it compares the current/updated objects to determine if the write (and thus new resource version) is necessary.

Ideally synthesizers would set the relevant fields to avoid hitting this code. But IMO it's a better protection against tightloops than fully trusting Eno's comparison logic.

@jveski jveski enabled auto-merge (squash) February 24, 2025 19:54
@jveski jveski merged commit 88ba332 into main Feb 24, 2025
29 checks passed
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

Successfully merging this pull request may close these issues.

2 participants