This is an automated email from the ASF dual-hosted git repository.
wilfreds pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/yunikorn-core.git
The following commit(s) were added to refs/heads/master by this push:
new cb7f2381 [YUNIKORN-3229] Upgrade go version to 1.26 (#1070)
cb7f2381 is described below
commit cb7f2381b6098f8936fe57dd7f13f205939a0021
Author: Aditya Maheshwari <[email protected]>
AuthorDate: Tue Feb 24 19:15:12 2026 +0100
[YUNIKORN-3229] Upgrade go version to 1.26 (#1070)
Closes: #1070
Signed-off-by: Wilfred Spiegelenburg <[email protected]>
---
.go_version | 2 +-
Makefile | 5 ++---
cmd/queueconfigchecker/queueconfigchecker.go | 2 ++
pkg/scheduler/objects/predicates.go | 8 ++++----
pkg/scheduler/objects/sorters_test.go | 1 +
pkg/scheduler/tests/restclient_test.go | 2 ++
pkg/webservice/handlers.go | 1 +
pkg/webservice/webservice_test.go | 1 +
8 files changed, 14 insertions(+), 8 deletions(-)
diff --git a/.go_version b/.go_version
index 5e2b9500..5ff8c4f5 100644
--- a/.go_version
+++ b/.go_version
@@ -1 +1 @@
-1.25
+1.26.0
diff --git a/Makefile b/Makefile
index 07f05506..b83ba443 100644
--- a/Makefile
+++ b/Makefile
@@ -24,7 +24,7 @@ GO := go
endif
GO_VERSION := $(shell "$(GO)" version | awk '{print substr($$3, 3, 4)}')
-MOD_VERSION := $(shell cat .go_version)
+MOD_VERSION := $(shell cat .go_version)
GM := $(word 1,$(subst ., ,$(GO_VERSION)))
MM := $(word 1,$(subst ., ,$(MOD_VERSION)))
@@ -98,7 +98,7 @@ endif
endif
# golangci-lint
-GOLANGCI_LINT_VERSION=2.7.0
+GOLANGCI_LINT_VERSION=2.10.1
GOLANGCI_LINT_PATH=$(TOOLS_DIR)/golangci-lint-v$(GOLANGCI_LINT_VERSION)
GOLANGCI_LINT_BIN=$(GOLANGCI_LINT_PATH)/golangci-lint
GOLANGCI_LINT_ARCHIVE=golangci-lint-$(GOLANGCI_LINT_VERSION)-$(OS)-$(EXEC_ARCH).tar.gz
@@ -237,4 +237,3 @@ clean:
distclean: clean
@echo "removing tools"
@rm -rf "${TOOLS_DIR}"
-
diff --git a/cmd/queueconfigchecker/queueconfigchecker.go
b/cmd/queueconfigchecker/queueconfigchecker.go
index dead2ef5..7f5610c8 100644
--- a/cmd/queueconfigchecker/queueconfigchecker.go
+++ b/cmd/queueconfigchecker/queueconfigchecker.go
@@ -30,10 +30,12 @@ A utility command to load queue configuration file and
check its validity
*/
func main() {
if len(os.Args) != 2 {
+ //nolint:gosec // safe to ignore, this is a utility command and
the argument is provided by the user
log.Println("Usage: " + os.Args[0] + " <queue-config-file>")
os.Exit(1)
}
queueFile := os.Args[1]
+ //nolint:gosec // safe to ignore, this is a utility command and the
file path is provided by the user
conf, err := os.ReadFile(queueFile)
if err != nil {
log.Printf("Could not read file: %v", err)
diff --git a/pkg/scheduler/objects/predicates.go
b/pkg/scheduler/objects/predicates.go
index 039abed7..e1730e68 100644
--- a/pkg/scheduler/objects/predicates.go
+++ b/pkg/scheduler/objects/predicates.go
@@ -152,10 +152,10 @@ func (p *predicateCheckResult) String() string {
return ""
}
var result strings.Builder
- result.WriteString(fmt.Sprintf("node: %s, ", p.nodeID))
- result.WriteString(fmt.Sprintf("alloc: %s, ", p.allocationKey))
- result.WriteString(fmt.Sprintf("success: %v, ", p.success))
- result.WriteString(fmt.Sprintf("index: %d", p.index))
+ fmt.Fprintf(&result, "node: %s, ", p.nodeID)
+ fmt.Fprintf(&result, "alloc: %s, ", p.allocationKey)
+ fmt.Fprintf(&result, "success: %v, ", p.success)
+ fmt.Fprintf(&result, "index: %d", p.index)
if len(p.victims) > 0 {
result.WriteString(", victims: [")
for i, victim := range p.victims {
diff --git a/pkg/scheduler/objects/sorters_test.go
b/pkg/scheduler/objects/sorters_test.go
index 0d7f0c91..1e8a47ec 100644
--- a/pkg/scheduler/objects/sorters_test.go
+++ b/pkg/scheduler/objects/sorters_test.go
@@ -390,6 +390,7 @@ func assertAppList(t *testing.T, list []*Application, place
[]int, name string)
func assertAppListLength(t *testing.T, list []*Application, apps []string,
name string) {
assert.Equal(t, len(apps), len(list), "length of list differs, test:
%s", name)
for i, app := range list {
+ //nolint:gosec //safe to ignore as we are asserting apps and
list have same length before
assert.Equal(t, apps[i], app.ApplicationID, "test name: %s",
name)
}
}
diff --git a/pkg/scheduler/tests/restclient_test.go
b/pkg/scheduler/tests/restclient_test.go
index 36240797..faf89e2a 100644
--- a/pkg/scheduler/tests/restclient_test.go
+++ b/pkg/scheduler/tests/restclient_test.go
@@ -50,6 +50,7 @@ func (c *RClient) GetEventsStream(count uint64)
(io.ReadCloser, error) {
return nil, err
}
req.URL.RawQuery = "count=" + strconv.FormatUint(count, 10)
+ //nolint:gosec // safe to ignore, this is a test client and the URL is
hardcoded to localhost
resp, err := http.DefaultClient.Do(req)
if err != nil {
return nil, err
@@ -77,6 +78,7 @@ func (c *RClient) newRequest(method, path string)
(*http.Request, error) {
}
func (c *RClient) do(req *http.Request, v interface{}) (*http.Response, error)
{
+ //nolint:gosec // safe to ignore, this is a test client and the URL is
hardcoded to localhost
resp, err := http.DefaultClient.Do(req)
if err != nil {
return nil, err
diff --git a/pkg/webservice/handlers.go b/pkg/webservice/handlers.go
index 02532862..f5cf9e44 100644
--- a/pkg/webservice/handlers.go
+++ b/pkg/webservice/handlers.go
@@ -123,6 +123,7 @@ func redirectDebug(w http.ResponseWriter, r *http.Request) {
w.WriteHeader(code)
// do as recommended in the RFC 7321, 6.4.2
body := "<a href=\"" + redirect + "\">" + http.StatusText(code) +
"</a>.\n"
+ //nolint:gosec // safe to ignore, body contains server side output and
is not based on user input
_, _ = fmt.Fprintln(w, body)
}
diff --git a/pkg/webservice/webservice_test.go
b/pkg/webservice/webservice_test.go
index 5c8cb66b..868df959 100644
--- a/pkg/webservice/webservice_test.go
+++ b/pkg/webservice/webservice_test.go
@@ -132,6 +132,7 @@ func Test_HeaderChecks(t *testing.T) {
req, err := http.NewRequest(tt.method, base+tt.reqURL,
nil)
assert.NilError(t, err, "unexpected error creating
request")
var resp *http.Response
+ //nolint:gosec // safe to ignore, this is a test client
and the URL is hardcoded to localhost
resp, err = client.Do(req)
assert.NilError(t, err, "unexpected error executing
request")
assert.Equal(t, resp.StatusCode, http.StatusOK,
"expected OK")
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]