Merge pull request #43016 from liggitt/time-added-pointer
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 <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.. Omit timeAdded from taint when empty Fixes omitempty portion of https://github.com/kubernetes/kubernetes/issues/42394
This commit is contained in:
@@ -33,11 +33,12 @@ import (
|
||||
var timeForControllerToProgress = 500 * time.Millisecond
|
||||
|
||||
func createNoExecuteTaint(index int) v1.Taint {
|
||||
now := metav1.Now()
|
||||
return v1.Taint{
|
||||
Key: "testTaint" + fmt.Sprintf("%v", index),
|
||||
Value: "test" + fmt.Sprintf("%v", index),
|
||||
Effect: v1.TaintEffectNoExecute,
|
||||
TimeAdded: metav1.Now(),
|
||||
TimeAdded: &now,
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -256,7 +256,8 @@ func RecordNodeStatusChange(recorder record.EventRecorder, node *v1.Node, newSta
|
||||
// otherwise.
|
||||
func SwapNodeControllerTaint(kubeClient clientset.Interface, taintsToAdd, taintsToRemove []*v1.Taint, node *v1.Node) bool {
|
||||
for _, taintToAdd := range taintsToAdd {
|
||||
taintToAdd.TimeAdded = metav1.Now()
|
||||
now := metav1.Now()
|
||||
taintToAdd.TimeAdded = &now
|
||||
}
|
||||
|
||||
err := controller.AddOrUpdateTaintOnNode(kubeClient, node.Name, taintsToAdd...)
|
||||
|
Reference in New Issue
Block a user