Skip to content

Commit

Permalink
modify taint
Browse files Browse the repository at this point in the history
  • Loading branch information
Stevent-fei committed Dec 6, 2022
1 parent c479603 commit 28b4885
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions pkg/cluster-runtime/installer.go
Original file line number Diff line number Diff line change
Expand Up @@ -256,14 +256,15 @@ func (i *Installer) setNodeTaints(hosts []net.IP, driver runtime.Driver) error {

for _, ip := range hosts {
taints := i.infraDriver.GetHostTaints(ip)
if taints != nil {
if k8snode, ok = nodeTaint[ip.String()]; ok {
newNode := k8snode.DeepCopy()
newNode.Spec.Taints = taints
newNode.SetResourceVersion("")
if err := driver.Update(context.TODO(), newNode); err != nil {
return err
}
if len(taints) == 0 {
continue
}
if k8snode, ok = nodeTaint[ip.String()]; ok {
newNode := k8snode.DeepCopy()
newNode.Spec.Taints = taints
newNode.SetResourceVersion("")
if err := driver.Update(context.TODO(), newNode); err != nil {
return err
}
}
}
Expand Down

0 comments on commit 28b4885

Please sign in to comment.