Skip to content

Commit a3e2498

Browse files
author
OpenShift Bot
authored
Merge pull request #12486 from fabianofranz/bugs_1279303
Merged by openshift-bot
2 parents 4bae8ee + 7ab32ff commit a3e2498

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

pkg/cmd/admin/node/schedulable.go

+5-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
package node
22

33
import (
4+
"fmt"
5+
6+
"k8s.io/kubernetes/pkg/api"
47
"k8s.io/kubernetes/pkg/kubectl"
58
kerrors "k8s.io/kubernetes/pkg/util/errors"
69
)
@@ -22,8 +25,8 @@ func (s *SchedulableOptions) Run() error {
2225
unschedulable := !s.Schedulable
2326
for _, node := range nodes {
2427
if node.Spec.Unschedulable != unschedulable {
25-
node.Spec.Unschedulable = unschedulable
26-
node, err = s.Options.KubeClient.Core().Nodes().Update(node)
28+
patch := fmt.Sprintf(`{"spec":{"unschedulable":%t}}`, unschedulable)
29+
node, err = s.Options.KubeClient.Core().Nodes().Patch(node.Name, api.MergePatchType, []byte(patch))
2730
if err != nil {
2831
errList = append(errList, err)
2932
continue

0 commit comments

Comments
 (0)