diff --git a/.golangci.yml b/.golangci.yml index 0b3a2fc64..29c11da10 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -52,6 +52,7 @@ linters: - shadow staticcheck: checks: + - SA4029 - SA5008 - ST1016 - ST1020 diff --git a/nomad/client_csi_endpoint.go b/nomad/client_csi_endpoint.go index 4052b380d..91056f898 100644 --- a/nomad/client_csi_endpoint.go +++ b/nomad/client_csi_endpoint.go @@ -6,7 +6,7 @@ package nomad import ( "errors" "fmt" - "sort" + "slices" "strings" "time" @@ -280,7 +280,7 @@ func (a *ClientCSI) sendCSINodeRPC(nodeID, method, fwdMethod, op string, args an return nil } -// clientIDsForController returns a shuffled list of client IDs where the +// clientIDsForController returns a sorted list of client IDs where the // controller plugin is expected to be running. func (a *ClientCSI) clientIDsForController(pluginID string) ([]string, error) { @@ -354,7 +354,7 @@ func (a *ClientCSI) clientIDsForController(pluginID string) ([]string, error) { // and have undocumented expectations of using k8s-specific sidecars to // leader elect. Sort the client IDs so that we prefer sending requests to // the same controller to hack around this. - clientIDs = sort.StringSlice(clientIDs) + slices.Sort(clientIDs) return clientIDs, nil }