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
Omit timeAdded from taint when empty #43016
Omit timeAdded from taint when empty #43016
Conversation
@kubernetes/sig-scheduling-pr-reviews |
2b3f203
to
00ac8ed
Compare
cc @smarterclayton @davidopp to verify we can do this in 1.7 without backcompat issues ignore the following, testing searching: This PR may require API review. If so, when the changes are ready, complete a pre-review checklist and request an API review. Status of requested reviews is tracked in the API Review project. |
Looks good. Thanks, @liggitt. |
/lgtm |
/approve |
@@ -58,17 +58,22 @@ var ( | |||
noScheduleTaints = []v1.Taint{{Key: "dedicated", Value: "user1", Effect: "NoSchedule"}} | |||
) | |||
|
|||
func nowPointer() *metav1.Time { |
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.
Why not add this into metav1
, named NowP() *Time
? So other developer can use it.
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'd rather not increase the exported API just yet
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.
Just grep the code, there're some similar logic to get "now" pointer. I'll create a PR to clear them up by "NowP()" :).
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 think it dilutes the metav1 package... there's no time.NowP()
function in the stdlib, for example
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 ok with that :)
Two lines to get "now" pointer seems boring :) ; just code style, no block comments to this PR :).
00ac8ed
to
db86e0b
Compare
/lgtm |
need rebase :). |
@kubernetes/sig-scheduling-api-reviews @kubernetes/api-reviewers can I get approval on this before spending time keeping it rebased? |
@liggitt , this was approved, can you help to rebase ? so we can merge it :). |
2ca6295
to
fe6af20
Compare
rebased, will leave up to @kubernetes/sig-scheduling-api-reviews whether this is important for 1.8 |
/cc @gmarek |
@@ -2466,7 +2466,7 @@ type Taint struct { | |||
// TimeAdded represents the time at which the taint was added. | |||
// It is only written for NoExecute taints. | |||
// +optional | |||
TimeAdded metav1.Time `json:"timeAdded,omitempty" protobuf:"bytes,4,opt,name=timeAdded"` | |||
TimeAdded *metav1.Time `json:"timeAdded,omitempty" protobuf:"bytes,4,opt,name=timeAdded"` |
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.
Isn't it a breaking API change in beta type?
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.
wire serialization remains compatible.
the old version encoded zero values to:
- json:
timeAdded: null
- proto: 0x22 tag with zero length value
the new version omits zero values from the wire format
the new version successfully decodes zero values from the old version
the old version treats missing values as the zero value when decoding
As long as we are backward compatible, I am fine with the change. /lgtm |
I'm fine to merge this in 1.9 :). |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: bsalamat, k82cn, liggitt, mikedanese Associated issue: 42394 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 |
/retest Review the full test history for this PR. |
1 similar comment
/retest Review the full test history for this PR. |
/test all [submit-queue is verifying that this PR is safe to merge] |
Automatic merge from submit-queue (batch tested with PRs 43016, 50503, 51281, 51518, 51582). If you want to cherry-pick this change to another branch, please follow the instructions here.. |
@liggitt: The following tests failed, say
Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR. 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. |
Fixes omitempty portion of #42394