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-release.git


The following commit(s) were added to refs/heads/master by this push:
     new 1d070a7  [YUNIKORN-3229] Update go version to 1.26 (#217)
1d070a7 is described below

commit 1d070a7eb5281280fc51d1a1554383e9b791ec82
Author: Aditya Maheshwari <[email protected]>
AuthorDate: Tue Feb 24 17:34:48 2026 +0100

    [YUNIKORN-3229] Update go version to 1.26 (#217)
    
    Closes: #217
    
    Signed-off-by: Wilfred Spiegelenburg <[email protected]>
---
 .go_version                           |  2 +-
 Makefile                              | 10 +++++++++-
 perf-tools/framework/app_analyzer.go  |  5 +++--
 perf-tools/framework/app_manager.go   |  2 +-
 perf-tools/framework/config.go        |  4 ++--
 perf-tools/framework/node_analyzer.go | 11 +++++++----
 perf-tools/framework/scenarios.go     |  3 ++-
 perf-tools/main.go                    |  3 ++-
 perf-tools/scenarios/common.go        |  5 +++--
 perf-tools/scenarios/e2e_perf.go      | 10 ++++++----
 perf-tools/scenarios/node_fairness.go | 11 ++++++-----
 perf-tools/scenarios/throughput.go    |  3 ++-
 perf-tools/utils/kubeclient.go        |  6 +++---
 perf-tools/utils/log.go               |  3 ++-
 perf-tools/utils/output.go            |  2 +-
 15 files changed, 50 insertions(+), 30 deletions(-)

diff --git a/.go_version b/.go_version
index 193d140..bc58404 100644
--- a/.go_version
+++ b/.go_version
@@ -1 +1 @@
-1.23
\ No newline at end of file
+1.26.0
\ No newline at end of file
diff --git a/Makefile b/Makefile
index 14de99f..d01ce19 100644
--- a/Makefile
+++ b/Makefile
@@ -98,7 +98,7 @@ endif
 endif
 
 # golangci-lint
-GOLANGCI_LINT_VERSION=1.63.4
+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
@@ -125,6 +125,14 @@ $(GOLANGCI_LINT_BIN):
        @curl -sSfL 
"https://github.com/golangci/golangci-lint/releases/download/v$(GOLANGCI_LINT_VERSION)/$(GOLANGCI_LINT_ARCHIVE)"
 \
                | tar -x -z --strip-components=1 -C "$(GOLANGCI_LINT_PATH)" 
"$(GOLANGCI_LINT_ARCHIVEBASE)/golangci-lint"
 
+.PHONY: format
+# Run go fmt and goimports
+format:
+       @echo "running go fmt"
+       @"$(GO)" fmt ./...
+       go install golang.org/x/tools/cmd/goimports@latest
+       goimports -local 
"github.com/apache/yunikorn-core,github.com/apache/yunikorn-scheduler,github.com/apache/yunikorn-release"
 -w .
+
 .PHONY: lint
 # Run lint against the previous commit for PR and branch build
 # In dev setup look at all changes on top of master
diff --git a/perf-tools/framework/app_analyzer.go 
b/perf-tools/framework/app_analyzer.go
index 58edae4..36d2745 100644
--- a/perf-tools/framework/app_analyzer.go
+++ b/perf-tools/framework/app_analyzer.go
@@ -23,8 +23,9 @@ import (
        "sort"
 
        "github.com/TaoYang526/goutils/pkg/profiling"
-       "github.com/apache/yunikorn-release/perf-tools/utils"
        "go.uber.org/zap"
+
+       "github.com/apache/yunikorn-release/perf-tools/utils"
 )
 
 type AppAnalyzer struct {
@@ -122,7 +123,7 @@ func (aa *AppAnalyzer) GetTasksProfiling() 
profiling.Profiling {
                for _, cond := range ts.Conditions {
                        prof.AddCheckpointWithTime(string(cond.CondType), 
cond.TransitionTime)
                }
-               //lastCondTime := 
ts.Conditions[len(ts.Conditions)-1].TransitionTime
+               // lastCondTime := 
ts.Conditions[len(ts.Conditions)-1].TransitionTime
                prof.FinishExecutionWithTime(true, endTime)
        }
        return prof
diff --git a/perf-tools/framework/app_manager.go 
b/perf-tools/framework/app_manager.go
index 40364ec..b74b4e7 100644
--- a/perf-tools/framework/app_manager.go
+++ b/perf-tools/framework/app_manager.go
@@ -109,7 +109,7 @@ func (dam *DeploymentsAppManager) Create(schedulerName 
string, appInfo *AppInfo)
                                                        constants.LabelAppID: 
appInfo.AppID,
                                                        constants.LabelQueue: 
appInfo.Queue,
                                                },
-                                               Annotations: 
appInfo.PodTemplateSpec.ObjectMeta.Annotations,
+                                               Annotations: 
appInfo.PodTemplateSpec.Annotations,
                                        },
                                        Spec: apiv1.PodSpec{
                                                SchedulerName: schedulerName,
diff --git a/perf-tools/framework/config.go b/perf-tools/framework/config.go
index 7109b9c..773cf9d 100644
--- a/perf-tools/framework/config.go
+++ b/perf-tools/framework/config.go
@@ -48,12 +48,12 @@ type CommonConfig struct {
 func InitConfig(configFile string) (*Config, error) {
        yamlContent, err := os.ReadFile(configFile)
        if err != nil {
-               return nil, fmt.Errorf("Failed to read config file: %s ", 
err.Error())
+               return nil, fmt.Errorf("failed to read config file: %s ", 
err.Error())
        }
        conf := Config{}
        err = yaml.Unmarshal(yamlContent, &conf)
        if err != nil {
-               return nil, fmt.Errorf("Failed to parse config file: %s ", 
err.Error())
+               return nil, fmt.Errorf("failed to parse config file: %s ", 
err.Error())
        }
        return &conf, nil
 }
diff --git a/perf-tools/framework/node_analyzer.go 
b/perf-tools/framework/node_analyzer.go
index 581be33..100a22b 100644
--- a/perf-tools/framework/node_analyzer.go
+++ b/perf-tools/framework/node_analyzer.go
@@ -21,12 +21,14 @@ package framework
 import (
        "fmt"
 
-       "github.com/apache/yunikorn-core/pkg/common/resources"
-       "github.com/apache/yunikorn-release/perf-tools/utils"
-       siCommon "github.com/apache/yunikorn-scheduler-interface/lib/go/common"
        "go.uber.org/zap"
        v1 "k8s.io/api/core/v1"
        metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+
+       "github.com/apache/yunikorn-core/pkg/common/resources"
+       siCommon "github.com/apache/yunikorn-scheduler-interface/lib/go/common"
+
+       "github.com/apache/yunikorn-release/perf-tools/utils"
 )
 
 type NodeAnalyzer struct {
@@ -145,6 +147,7 @@ func (na *NodeAnalyzer) 
GetNodeResourceDistribution(tasksDistribution [][]*TaskS
                // calculate current distribution
                bucketsInThisSecond := 
calculateResourceDistribution(nodeResources)
                for level, num := range bucketsInThisSecond {
+                       // #nosec G602 -- level is guaranteed to be in [0,9] by 
calculateResourceDistribution function
                        buckets[level] = append(buckets[level], num)
                }
        }
@@ -162,7 +165,7 @@ func calculateResourceDistribution(resources 
map[string][]int64) [10]int {
                        }
                        buckets[bucketIndex] += 1
                } else {
-                       panic(fmt.Errorf("Error resources: %+v ", 
resourceValues))
+                       panic(fmt.Errorf("error resources: %+v ", 
resourceValues))
                }
        }
        return buckets
diff --git a/perf-tools/framework/scenarios.go 
b/perf-tools/framework/scenarios.go
index ace4ef2..9fe28d9 100644
--- a/perf-tools/framework/scenarios.go
+++ b/perf-tools/framework/scenarios.go
@@ -19,8 +19,9 @@
 package framework
 
 import (
-       "github.com/apache/yunikorn-release/perf-tools/utils"
        "go.uber.org/zap"
+
+       "github.com/apache/yunikorn-release/perf-tools/utils"
 )
 
 type TestScenarios struct {
diff --git a/perf-tools/main.go b/perf-tools/main.go
index 385a204..3dd1a78 100644
--- a/perf-tools/main.go
+++ b/perf-tools/main.go
@@ -29,9 +29,10 @@ import (
 
        "github.com/apache/yunikorn-release/perf-tools/utils"
 
+       "go.uber.org/zap"
+
        "github.com/apache/yunikorn-release/perf-tools/framework"
        _ "github.com/apache/yunikorn-release/perf-tools/scenarios"
-       "go.uber.org/zap"
 )
 
 const (
diff --git a/perf-tools/scenarios/common.go b/perf-tools/scenarios/common.go
index 55a6154..40e59df 100644
--- a/perf-tools/scenarios/common.go
+++ b/perf-tools/scenarios/common.go
@@ -22,10 +22,11 @@ import (
        "fmt"
        "time"
 
-       "github.com/apache/yunikorn-release/perf-tools/framework"
-       "github.com/apache/yunikorn-release/perf-tools/utils"
        "github.com/mitchellh/mapstructure"
        "go.uber.org/zap"
+
+       "github.com/apache/yunikorn-release/perf-tools/framework"
+       "github.com/apache/yunikorn-release/perf-tools/utils"
 )
 
 func LoadScenarioConf(conf *framework.Config, scenarioName string, 
scenarioConf interface{}) error {
diff --git a/perf-tools/scenarios/e2e_perf.go b/perf-tools/scenarios/e2e_perf.go
index f5b3ec4..34595dd 100644
--- a/perf-tools/scenarios/e2e_perf.go
+++ b/perf-tools/scenarios/e2e_perf.go
@@ -25,9 +25,10 @@ import (
        "time"
 
        "github.com/TaoYang526/goutils/pkg/profiling"
+       "go.uber.org/zap"
+
        "github.com/apache/yunikorn-release/perf-tools/framework"
        "github.com/apache/yunikorn-release/perf-tools/utils"
-       "go.uber.org/zap"
 )
 
 const E2EPerfScenarioName = "e2e_perf"
@@ -158,7 +159,7 @@ func (eps *E2EPerfScenario) Run(results *utils.Results) {
                        statsOutputName := "time statistics"
                        stats := prof.GetTimeStatistics()
                        statsTable := ParseTableFromStatistic(stats)
-                       if err := statsTable.Output(statsTableFilePath); err != 
nil {
+                       if err = statsTable.Output(statsTableFilePath); err != 
nil {
                                
caseVerification.AddSubVerification(statsOutputName,
                                        fmt.Sprintf("failed to output %s: %s", 
statsOutputName, err.Error()),
                                        utils.FAILED)
@@ -170,14 +171,15 @@ func (eps *E2EPerfScenario) Run(results *utils.Results) {
                        qpsStatsTableFilePath := 
fmt.Sprintf("%s/%s-case%d-qps-stat.txt",
                                eps.commonConf.OutputPath, eps.GetName(), 
caseIndex)
                        qpsStatsOutputName := "QPS statistics"
-                       qpsStat, err := prof.GetQPSStatistics()
+                       var qpsStat *profiling.QPSStatistics
+                       qpsStat, err = prof.GetQPSStatistics()
                        if err != nil {
                                
caseVerification.AddSubVerification(qpsStatsOutputName,
                                        fmt.Sprintf("failed to output %s: %s", 
qpsStatsOutputName, err.Error()),
                                        utils.FAILED)
                        }
                        qpsStatsTable := ParseTableFromQPSStatistics(qpsStat, 
framework.GetOrderedTaskConditionTypes())
-                       if err := qpsStatsTable.Output(qpsStatsTableFilePath); 
err != nil {
+                       if err = qpsStatsTable.Output(qpsStatsTableFilePath); 
err != nil {
                                
caseVerification.AddSubVerification(qpsStatsOutputName,
                                        fmt.Sprintf("failed to output %s: %s", 
qpsStatsOutputName, err.Error()),
                                        utils.FAILED)
diff --git a/perf-tools/scenarios/node_fairness.go 
b/perf-tools/scenarios/node_fairness.go
index b3311b4..b7f7417 100644
--- a/perf-tools/scenarios/node_fairness.go
+++ b/perf-tools/scenarios/node_fairness.go
@@ -23,13 +23,13 @@ import (
        "strconv"
        "time"
 
-       "github.com/apache/yunikorn-release/perf-tools/constants"
-       "github.com/apache/yunikorn-release/perf-tools/utils"
-       siCommon "github.com/apache/yunikorn-scheduler-interface/lib/go/common"
+       "go.uber.org/zap"
        v1 "k8s.io/api/core/v1"
 
+       "github.com/apache/yunikorn-release/perf-tools/constants"
        "github.com/apache/yunikorn-release/perf-tools/framework"
-       "go.uber.org/zap"
+       "github.com/apache/yunikorn-release/perf-tools/utils"
+       siCommon "github.com/apache/yunikorn-scheduler-interface/lib/go/common"
 )
 
 const NodeFairnessScenarioName = "node_fairness"
@@ -125,6 +125,7 @@ func (nfs *NodeFairnessScenario) Run(results 
*utils.Results) {
                        zap.Any("requestResources", requestResources))
 
                // init app info & app manager
+               // #nosec G115 - This is a false positive, the input is 
controlled and safe
                requestInfo := framework.NewRequestInfo(int32(expectedNumPods), 
"", requestResources, nil)
                appInfo = framework.NewAppInfo(nfs.commonConf.Namespace, 
NodeFairnessScenarioName, nfs.commonConf.Queue,
                        []*framework.RequestInfo{requestInfo}, 
nfs.commonConf.PodTemplateSpec, nfs.commonConf.PodSpec)
@@ -164,7 +165,7 @@ func (nfs *NodeFairnessScenario) Run(results 
*utils.Results) {
                        tableOutputName := "output node distribution timeline 
table"
                        utils.Logger.Info(tableOutputName)
                        table.Print()
-                       if err := table.Output(tableFilePath); err != nil {
+                       if err = table.Output(tableFilePath); err != nil {
                                
schedulerVerification.AddSubVerification(tableOutputName,
                                        fmt.Sprintf("failed to output node 
distribution timeline table: %s", err.Error()),
                                        utils.FAILED)
diff --git a/perf-tools/scenarios/throughput.go 
b/perf-tools/scenarios/throughput.go
index 88aced0..b1d7bd3 100644
--- a/perf-tools/scenarios/throughput.go
+++ b/perf-tools/scenarios/throughput.go
@@ -22,10 +22,11 @@ import (
        "fmt"
        "time"
 
+       "go.uber.org/zap"
+
        "github.com/apache/yunikorn-release/perf-tools/constants"
        "github.com/apache/yunikorn-release/perf-tools/framework"
        "github.com/apache/yunikorn-release/perf-tools/utils"
-       "go.uber.org/zap"
 )
 
 const ThroughputScenarioName = "throughput"
diff --git a/perf-tools/utils/kubeclient.go b/perf-tools/utils/kubeclient.go
index 394654f..47bb8be 100644
--- a/perf-tools/utils/kubeclient.go
+++ b/perf-tools/utils/kubeclient.go
@@ -41,9 +41,9 @@ type KubeClient struct {
        configs   *rest.Config
 }
 
-func NewKubeClient(KubeConfigFile string) (*KubeClient, error) {
-       kubeConfigFile := os.ExpandEnv(KubeConfigFile)
-       fmt.Println(KubeConfigFile)
+func NewKubeClient(kubeConfigFilePath string) (*KubeClient, error) {
+       fmt.Println(kubeConfigFilePath)
+       kubeConfigFile := os.ExpandEnv(kubeConfigFilePath)
        if kubeConfigFile == "" {
                return nil, fmt.Errorf("specified kubeconfig file %s not 
found", kubeConfigFile)
        }
diff --git a/perf-tools/utils/log.go b/perf-tools/utils/log.go
index 4e04495..86940f4 100644
--- a/perf-tools/utils/log.go
+++ b/perf-tools/utils/log.go
@@ -21,8 +21,9 @@ package utils
 import (
        "strconv"
 
-       "github.com/apache/yunikorn-core/pkg/log"
        "go.uber.org/zap"
+
+       "github.com/apache/yunikorn-core/pkg/log"
 )
 
 var Logger *zap.Logger = log.Log(log.Test)
diff --git a/perf-tools/utils/output.go b/perf-tools/utils/output.go
index 4c46740..9389702 100644
--- a/perf-tools/utils/output.go
+++ b/perf-tools/utils/output.go
@@ -144,7 +144,7 @@ func (vg *Verification) AddSubVerification(name, 
description string, status Veri
                        parentVer = parentVer.Parent
                }
        }
-       //Logger.Info(getVerificationStatusInfo(subVerification))
+       // Logger.Info(getVerificationStatusInfo(subVerification))
        return subVerification
 }
 


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to