mirror of
https://github.com/kubereboot/kured.git
synced 2026-08-19 03:16:23 +00:00
chore: Quick fix to pass linters
This whole block should be refactored, but this will be done inside v2. At the same time, it should not block the golangci-lint, so I did exactly what the golangci lint wanted to have. Signed-off-by: Jean-Philippe Evrard <open-source@a.spamming.party>
This commit is contained in:
@@ -15,6 +15,8 @@ import (
|
||||
"k8s.io/client-go/kubernetes"
|
||||
)
|
||||
|
||||
const addOrRemoveJSONOp = "add"
|
||||
|
||||
// Taint allows to set soft and hard limitations for scheduling and executing pods on nodes.
|
||||
type Taint struct {
|
||||
client *kubernetes.Clientset
|
||||
@@ -107,7 +109,6 @@ func preferNoSchedule(client *kubernetes.Clientset, nodeID, taintName string, ef
|
||||
}
|
||||
|
||||
var patches []patchTaints
|
||||
|
||||
if len(updatedNode.Spec.Taints) == 0 {
|
||||
// add first taint and ensure to keep current taints
|
||||
patches = []patchTaints{
|
||||
@@ -117,12 +118,12 @@ func preferNoSchedule(client *kubernetes.Clientset, nodeID, taintName string, ef
|
||||
Value: updatedNode.Spec,
|
||||
},
|
||||
{
|
||||
Op: "add",
|
||||
Op: addOrRemoveJSONOp,
|
||||
Path: "/spec/taints",
|
||||
Value: []v1.Taint{},
|
||||
},
|
||||
{
|
||||
Op: "add",
|
||||
Op: addOrRemoveJSONOp,
|
||||
Path: "/spec/taints/-",
|
||||
Value: taint,
|
||||
},
|
||||
@@ -144,7 +145,7 @@ func preferNoSchedule(client *kubernetes.Clientset, nodeID, taintName string, ef
|
||||
// add missing taint to exsting list
|
||||
patches = []patchTaints{
|
||||
{
|
||||
Op: "add",
|
||||
Op: addOrRemoveJSONOp,
|
||||
Path: "/spec/taints/-",
|
||||
Value: taint,
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user