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
pull/6/head
Kubernetes Submit Queue 2017-05-04 15:54:39 -07:00 committed by GitHub
commit 5a9759b0b4
1 changed files with 1 additions and 1 deletions

View File

@ -58,7 +58,7 @@ func attemptToUpdateMasterRoleLabelsAndTaints(client *clientset.Clientset) error
// The master node is tainted and labelled accordingly // The master node is tainted and labelled accordingly
n.ObjectMeta.Labels[kubeadmconstants.LabelNodeRoleMaster] = "" 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) newData, err := json.Marshal(n)
if err != nil { if err != nil {