Merge pull request #46514 from ravisantoshgudimetla/scheduler_taints_refactor
Automatic merge from submit-queue (batch tested with PRs 49420, 49296, 49299, 49371, 46514) Refactoring taint functions to reduce sprawl **What this PR does / why we need it**: **Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes #45060 **Special notes for your reviewer**: @gmarek @timothysc @k82cn @jayunit100 - I moved some fn's to helpers and some to utils. LMK, if you are ok with this change. **Release note**: ```release-note NONE ```
This commit is contained in:
@@ -44,11 +44,11 @@ import (
|
||||
ref "k8s.io/client-go/tools/reference"
|
||||
"k8s.io/client-go/util/integer"
|
||||
_ "k8s.io/kubernetes/pkg/api/install"
|
||||
v1helper "k8s.io/kubernetes/pkg/api/v1/helper"
|
||||
podutil "k8s.io/kubernetes/pkg/api/v1/pod"
|
||||
"k8s.io/kubernetes/pkg/api/validation"
|
||||
clientretry "k8s.io/kubernetes/pkg/client/retry"
|
||||
hashutil "k8s.io/kubernetes/pkg/util/hash"
|
||||
taintutils "k8s.io/kubernetes/pkg/util/taints"
|
||||
|
||||
"github.com/golang/glog"
|
||||
)
|
||||
@@ -901,7 +901,7 @@ func AddOrUpdateTaintOnNode(c clientset.Interface, nodeName string, taint *v1.Ta
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
newNode, ok, err := v1helper.AddOrUpdateTaint(oldNode, taint)
|
||||
newNode, ok, err := taintutils.AddOrUpdateTaint(oldNode, taint)
|
||||
if err != nil {
|
||||
return fmt.Errorf("Failed to update taint annotation!")
|
||||
}
|
||||
@@ -945,7 +945,7 @@ func RemoveTaintOffNode(c clientset.Interface, nodeName string, taint *v1.Taint,
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
newNode, ok, err := v1helper.RemoveTaint(oldNode, taint)
|
||||
newNode, ok, err := taintutils.RemoveTaint(oldNode, taint)
|
||||
if err != nil {
|
||||
return fmt.Errorf("Failed to update taint annotation!")
|
||||
}
|
||||
|
Reference in New Issue
Block a user