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.
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.
@bgrant0607 are we going to require every client submitting a scale request do a Get first and handle retry on conflict, or allow an empty resource version if the client doesn't care about current state and just wants to submit a scale request? I'd expect to only set this if
len(scale.ResourceVersion) > 0
. Same goes for the Update methods on Deployments and ReplicaSet, I thinkThere 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.
@liggitt If scale.ResourceVersion is empty string, this should result in an unconditional update, whereas if we didn't copy the empty string, the user could get spurious update failures.
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.
Ah, I'd forgotten that. That means if the client's intent was to only update the scale bit unconditionally, that means the server-side impl could stomp a change in another part of the rc/rs/deployment.
If the incoming scale has no ResourceVersion, I would expect the server to do the get/update inside a retryonconflict loop, fulfilling client intent while being a good citizen and not stomping bits unrelated to scale. I guess we don't do that today, so it's not a regression, and the window is small, but it would be an improvement (whether or not it happens for 1.2)