From 45bd82c4ba7fbac6301adccd8f62f0713504b08a Mon Sep 17 00:00:00 2001 From: Jean-Philippe Evrard Date: Mon, 8 Jun 2026 15:11:16 +0200 Subject: [PATCH 1/2] Bump golangci-lint This will allow to bump golang to 1.26 without issues. Signed-off-by: Jean-Philippe Evrard --- .mise/config.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.mise/config.toml b/.mise/config.toml index 5e64698..dd588a7 100644 --- a/.mise/config.toml +++ b/.mise/config.toml @@ -1,7 +1,7 @@ [tools] cosign = "2.2.3" go = "1.25.11" -golangci-lint = "2.7.2" +golangci-lint = "2.12.2" goreleaser = "1.24.0" kind = "0.31.0" kubectl = "1.35.0" From 896ee8d1832233c745993ee9a109c2fb934b7103 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Evrard Date: Mon, 8 Jun 2026 15:15:55 +0200 Subject: [PATCH 2/2] 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 --- pkg/taints/taints.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/pkg/taints/taints.go b/pkg/taints/taints.go index 54a0441..8ae039c 100644 --- a/pkg/taints/taints.go +++ b/pkg/taints/taints.go @@ -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, },