Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
apiextensions apiserver: update storage version for custom resources #96403
apiextensions apiserver: update storage version for custom resources #96403
Changes from 6 commits
2aa2965
ac6a4ea
5ff32e9
2c902a4
5faab59
35d9ffc
8661f73
3cd443e
6ddc1eb
100aa3b
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
makes code a little bit prettier everywhere.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the goal of blocking writes before StorageVersion update is to make sure we don't accidentally persist data in some version that the storage migrator is unaware of. Deleted CRs are not persisted, so I think it's okay to unblock these requests.
done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They are if they have finalizers on them (a delete request populates metadata.deletionTimestamp and re-persists)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ack. I will double check and think about the deadlock
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are we sure the only case for
abort==true
is CRD deletion?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(other than the new "should not happen" panic handling) yes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we don't block delete requests, and I'm not sure if the storage DestroyFunc goes through this code path.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we won't deadlock because the CRD finalizer doesn't go through this code path to cleanup CRs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the error state is transient and only for in-flight requests. A CR client can retry:
had 503 originally (ref #96403 (comment)). I'm okay with 503. If we assume a CR client and a CRD client are the same user, then 403 (let the user fix the request/situation) also makes sense
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With this timeout we risk an inconsistent storage version state, right? Am still unsure whether is worse: bad storage version object or failing CRD writes.
@liggitt would like to hear your opinion.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm finding the handling of a CR really hard to reason about in this PR, especially with a long (O(seconds)) delay between constructing the serving info at the top of this method and returning to unblock serving
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sttts I considered failing CRD writes a regression, but I'm okay with that direction if we think it's necessary. Let me add some change in that direction
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we cannot write the StorageVersion object, we have big problems anyway. Do we care about CRD writes in this case?