Commit 5a9759b0 authored by Kubernetes Submit Queue's avatar Kubernetes Submit Queue Committed by GitHub

Merge pull request #45376 from luxas/kubeadm_fix_taints

Automatic merge from submit-queue (batch tested with PRs 45309, 45376) kubeadm: Fix the tainting of the master node **What this PR does / why we need it**: Currently, kubeadm unintentionally removes Taints set with the kubelet flag `--register-with-taints` when creating a new Taint slice instead of appening the existing one. This PR fixes that behavior. **Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes # **Special notes for your reviewer**: This should be a cherrypick candidate for v1.6 cc @enisoc **Release note**: ```release-note kubeadm: Fix invalid assign statement so it is possible to register the master kubelet with other initial Taints ``` @jbeda @dmmcquay @mikedanese @krousey PTAL, very straightforward PR
parents 3ae08b83 60658249
......@@ -58,7 +58,7 @@ func attemptToUpdateMasterRoleLabelsAndTaints(client *clientset.Clientset) error
// The master node is tainted and labelled accordingly
n.ObjectMeta.Labels[kubeadmconstants.LabelNodeRoleMaster] = ""
n.Spec.Taints = []v1.Taint{{Key: kubeadmconstants.LabelNodeRoleMaster, Value: "", Effect: "NoSchedule"}}
n.Spec.Taints = append(n.Spec.Taints, v1.Taint{Key: kubeadmconstants.LabelNodeRoleMaster, Value: "", Effect: "NoSchedule"})
newData, err := json.Marshal(n)
if err != nil {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment