-
Notifications
You must be signed in to change notification settings - Fork 39.8k
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
Backward compatibility in EmptyDirVolumeSource after v1.7.8 #56505
Backward compatibility in EmptyDirVolumeSource after v1.7.8 #56505
Conversation
Thanks for your pull request. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). 📝 Please follow instructions at https://github.com/kubernetes/kubernetes/wiki/CLA-FAQ to sign the CLA. It may take a couple minutes for the CLA signature to be fully registered; after that, please reply here with a new comment and we'll verify. Thanks.
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
/assign @jbeda |
/ok-to-test |
hello? Anyone following up with this PR? |
if mungedPod.Spec.Volumes[idx].EmptyDir.SizeLimit != nil { | ||
// If EmptyDir.SizeLimit is set to "0", then take SizeLimit as a nil value | ||
if mungedPod.Spec.Volumes[idx].EmptyDir.SizeLimit.String() == "0" && vol.EmptyDir.SizeLimit == nil { | ||
mungedPod.Spec.Volumes[idx].EmptyDir.SizeLimit = nil |
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.
This field should already be dropped by this line prior to validation:
kubernetes/pkg/api/pod/util.go
Line 242 in c933067
podSpec.Volumes[i].EmptyDir.SizeLimit = nil |
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.
It seems that this DropDisabledAlphaFields
function is written after 1.8.0 release.
But [v1.7.8~v1.8.0) didn't have this before validation, can I submit this PR onto release-1.7 branch
?
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.
It would be better to add the DropDisabledAlphaFields part to the 1.7.x branch than this
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.
Ok, I will update this PR dat way.
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.
Hi, Could you review my PR again plz? Thx
This comment has been minimized.
This comment has been minimized.
/area apiserver |
a384ae0
to
7efae04
Compare
@liggitt PTAL.Thx. |
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: liggitt, yue9944882 Associated issue: 56381 The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these OWNERS Files:
You can indicate your approval by writing |
That means it's pending approval by the 1.7 release branch manager. |
The PR obviously makes perfect sense for cherrypicking. @yue9944882 @liggitt - can one of you add user-friendly release note to it? |
@wojtek-t PTAL. Release note updated. |
Thanks - approved. |
/test all [submit-queue is verifying that this PR is safe to merge] |
Automatic merge from submit-queue. |
In lower versions of k8s client sdk (golang, java..), requests can be incompatible with apiserver after v1.7.8 because of this commit. The field
SizeLimit
inEmptyDirVolumeSource
struct is no longer a value but a pointer ofresource.Quantity
. And the default value ofSizeLimit
is {"Medium":"", "SizeLimit":"0"} but now a nil.So this PR make apiserver able to process client request made by lower versions of k8s client sdk without simply throw out an error:
What this PR does / why we need it:
Which issue(s) this PR fixes (optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)
format, will close the issue(s) when PR gets merged):Fixes #56381
Special notes for your reviewer:
Release note: