mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 19:56:01 +00:00
In AddOrUpdateTaintOnNode create annotation map if its nil
This commit is contained in:
parent
e18eda9b2b
commit
292cea1a18
@ -2914,6 +2914,10 @@ func AddOrUpdateTaintOnNode(c *client.Client, nodeName string, taint api.Taint)
|
||||
|
||||
taintsData, err := json.Marshal(newTaints)
|
||||
ExpectNoError(err)
|
||||
|
||||
if node.Annotations == nil {
|
||||
node.Annotations = make(map[string]string)
|
||||
}
|
||||
node.Annotations[api.TaintsAnnotationKey] = string(taintsData)
|
||||
_, err = c.Nodes().Update(node)
|
||||
ExpectNoError(err)
|
||||
|
Loading…
Reference in New Issue
Block a user