-
Notifications
You must be signed in to change notification settings - Fork 458
frontend: EditButton: Use JSON patch to prevent resource version conflicts #4098
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
base: main
Are you sure you want to change the base?
frontend: EditButton: Use JSON patch to prevent resource version conflicts #4098
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: jaehanbyun The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
…licts Signed-off-by: jaehanbyun <awbrg789@naver.com>
0fb7696 to
f6923f8
Compare
Signed-off-by: jaehanbyun <awbrg789@naver.com>
|
This is a really nice fix. I need some time to test it though. So I marked it for the 0.38.0 release. My initial question is what happens if someone else updates it in the mean time? Do you handle this case? |
|
@illume I tested concurrent edits to answer your question:
|
|
I wonder if last-write-wins is the way in these cases? I think it could be a bit dangerous. Currently it doesn't let them apply, so they have to try again. It's not a good experience, but at least they need to try make the change again and take into consideration the changes. The alternative could be:
Basically show them the conflict with a default of the last write... but make them confirm the change... and let them have an opportunity to change it (maybe keeping the other change). What do you think? |
|
@illume Yeah, handling the three cases as you described would definitely provide a better UX.
What do you think about proceeding with this approach before we start implementing it? |
Summary
This PR fixes 409 Conflict errors in the YAML editor.
The editor now sends only the changed fields instead of the entire resource, significantly reducing conflicts on frequently updated resources like Nodes.
Related Issue
Fixes #4097
Changes
Before
The editor performed a full PUT request with the entire resource object:
Problem: If the resource's
resourceVersionchanged between opening the editor and saving (e.g., kubelet updating Node status), Kubernetes rejected the request with 409 Conflict.After
The editor now captures the original snapshot and sends only the diff:
Benefit: Only changed fields are sent, dramatically reducing conflict probability even when the resource is modified by other processes.
Steps to Test
Screenshots (if applicable)
Before
After
Notes for the Reviewer