Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: bump go and dependencies #2649

Merged
merged 4 commits into from
Feb 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
name: "CodeQL"

env:
GO_VERSION: "1.21.6"
GO_VERSION: "1.21.7"

on:
push:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/go.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Build, Test, Lint License

env:
GO_VERSION: "1.21.6"
GO_VERSION: "1.21.7"

on:
push:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/golangci-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
steps:
- uses: actions/setup-go@v5
with:
go-version: '1.21.6'
go-version: '1.21.7'
- uses: actions/checkout@v4
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
Expand Down
10 changes: 5 additions & 5 deletions cmd/collectors/rest/rest.go
Original file line number Diff line number Diff line change
Expand Up @@ -643,23 +643,23 @@ func (r *Rest) CollectAutoSupport(p *collector.Payload) {

if r.Object == "Node" || r.Name == "ems" {
var (
nodeIds []collector.ID
nodeIDs []collector.ID
err error
)
nodeIds, err = r.getNodeUuids()
nodeIDs, err = r.getNodeUuids()
if err != nil {
// log but don't return so the other info below is collected
r.Logger.Error().
Err(err).
Msg("Unable to get nodes.")
}
info.Ids = nodeIds
info.Ids = nodeIDs
p.Nodes = &info

// Since the serial number is bogus in c-mode
// use the first node's serial number instead (the nodes were ordered in getNodeUuids())
if len(nodeIds) > 0 {
p.Target.Serial = nodeIds[0].SerialNumber
if len(nodeIDs) > 0 {
p.Target.Serial = nodeIDs[0].SerialNumber
}
}
if r.Object == "Volume" {
Expand Down
6 changes: 3 additions & 3 deletions cmd/collectors/restperf/restperf.go
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ func (r *RestPerf) pollCounter(records []gjson.Result, apiD time.Duration) (map[
return nil, errs.New(errs.ErrConfig, "no data found")
}
// populate denominator metric to prop metrics
counterSchema.ForEach(func(key, c gjson.Result) bool {
counterSchema.ForEach(func(_, c gjson.Result) bool {
if !c.IsObject() {
r.Logger.Warn().Str("type", c.Type.String()).Msg("Counter is not object, skipping")
return true
Expand Down Expand Up @@ -431,7 +431,7 @@ func parseMetricResponses(instanceData gjson.Result, metric map[string]*rest2.Me
instanceData.ForEach(func(key, v gjson.Result) bool {
keyS := key.String()
if keyS == "counters" {
v.ForEach(func(key, each gjson.Result) bool {
v.ForEach(func(_, each gjson.Result) bool {
if numSeen == numWant {
return false
}
Expand Down Expand Up @@ -469,7 +469,7 @@ func parseMetricResponses(instanceData gjson.Result, metric map[string]*rest2.Me
var finalLabels []string
var finalValues []string
var vLen int
subCounters.ForEach(func(key, subCounter gjson.Result) bool {
subCounters.ForEach(func(_, subCounter gjson.Result) bool {
label := strings.Clone(subCounter.Get("label").String())
subValues := subCounter.Get("values").String()
m := util.ArrayMetricToString(strings.Clone(subValues))
Expand Down
8 changes: 4 additions & 4 deletions cmd/collectors/storagegrid/storagegrid.go
Original file line number Diff line number Diff line change
Expand Up @@ -547,15 +547,15 @@ func (s *StorageGrid) CollectAutoSupport(p *collector.Payload) {
p.Target.ClusterUUID = s.client.Cluster.UUID

if p.Nodes == nil {
nodeIds, err := s.getNodeUuids()
nodeIDs, err := s.getNodeUuids()
if err != nil {
// log the error, but don't exit method so subsequent info is collected
s.Logger.Error().Err(err).Msg("Unable to get nodes.")
nodeIds = make([]collector.ID, 0)
nodeIDs = make([]collector.ID, 0)
}
p.Nodes = &collector.InstanceInfo{
Ids: nodeIds,
Count: int64(len(nodeIds)),
Ids: nodeIDs,
Count: int64(len(nodeIDs)),
}
}

Expand Down
10 changes: 5 additions & 5 deletions cmd/collectors/zapi/collector/zapi.go
Original file line number Diff line number Diff line change
Expand Up @@ -483,23 +483,23 @@ func (z *Zapi) CollectAutoSupport(p *collector.Payload) {

if z.Object == "Node" {
var (
nodeIds []collector.ID
nodeIDs []collector.ID
err error
)
nodeIds, err = z.getNodeUuids()
nodeIDs, err = z.getNodeUuids()
if err != nil {
// log but don't return so the other info below is collected
z.Logger.Error().
Err(err).
Msg("Unable to get nodes.")
}
info.Ids = nodeIds
info.Ids = nodeIDs
p.Nodes = &info
if z.Client.IsClustered() {
// Since the serial number is bogus in c-mode
// use the first node's serial number instead (the nodes were ordered in getNodeUuids())
if len(nodeIds) > 0 {
p.Target.Serial = nodeIds[0].SerialNumber
if len(nodeIDs) > 0 {
p.Target.Serial = nodeIDs[0].SerialNumber
}
}
} else if z.Object == "Volume" {
Expand Down
2 changes: 1 addition & 1 deletion cmd/harvest/version/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ func latestRelease() (string, error) {
Transport: &http.Transport{},
Timeout: 5 * time.Second,
}
client.CheckRedirect = func(req *http.Request, via []*http.Request) error {
client.CheckRedirect = func(_ *http.Request, _ []*http.Request) error {
return errors.New("redirect")
}
resp, err := client.Get(githubReleases)
Expand Down
2 changes: 1 addition & 1 deletion cmd/poller/collector/asup.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ type InstanceInfo struct {
APITime int64
ParseTime int64
PluginTime int64
Ids []ID `json:"Ids,omitempty"`
Ids []ID `json:"Ids,omitempty"` // revive:disable-line var-naming
}

type Process struct {
Expand Down
3 changes: 3 additions & 0 deletions cmd/tools/doctor/doctor.go
Original file line number Diff line number Diff line change
Expand Up @@ -339,6 +339,9 @@ func templateExists(searchDir string, templateName string) bool {
// recursively search searchDir for a file named templateName
found := false
err := filepath.WalkDir(searchDir, func(path string, d fs.DirEntry, err error) error {
if err != nil {
return err
}
if d.IsDir() {
return nil
}
Expand Down
7 changes: 5 additions & 2 deletions cmd/tools/doctor/restZapiDiff.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@ func DoDiffRestZapi(zapiDataCenterName string, restDataCenterName string) {

func getWalkFunc(searchKey string, dashboardDiffMap map[string][]string, key string) filepath.WalkFunc {
return func(path string, fi os.FileInfo, err error) error {
if err != nil {
return err
}
if !fi.IsDir() {
b, err := os.ReadFile(path)
if err != nil {
Expand Down Expand Up @@ -699,11 +702,11 @@ func getLabelNames(query string) map[string][]string {
data, _ := getResponse(queryURL)

result := gjson.Get(data, "data")
result.ForEach(func(key, value gjson.Result) bool {
result.ForEach(func(_, value gjson.Result) bool {
labelName := value.Get("__name__")
if strings.Contains(labelName.String(), "_labels") {
v := value.Get("@keys")
v.ForEach(func(key, value gjson.Result) bool {
v.ForEach(func(_, value gjson.Result) bool {
dataMap[labelName.String()] = appendIfMissing(dataMap[labelName.String()], value.String())
return true // keep iterating
})
Expand Down
10 changes: 5 additions & 5 deletions cmd/tools/generate/counter.go
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ func processRestCounters(client *rest.Client) map[string]Counter {
return processRestPerfCounters(path, client)
})

restCounters := visitRestTemplates("conf/rest", client, func(path string, client *rest.Client) map[string]Counter {
restCounters := visitRestTemplates("conf/rest", client, func(path string, client *rest.Client) map[string]Counter { // revive:disable-line:unused-parameter
return processRestConfigCounters(path)
})

Expand All @@ -186,7 +186,7 @@ func processRestCounters(client *rest.Client) map[string]Counter {

// processZapiCounters parse zapi and zapiperf templates
func processZapiCounters(client *zapi.Client) map[string]Counter {
zapiCounters := visitZapiTemplates("conf/zapi/cdot", client, func(path string, client *zapi.Client) map[string]Counter {
zapiCounters := visitZapiTemplates("conf/zapi/cdot", client, func(path string, client *zapi.Client) map[string]Counter { // revive:disable-line:unused-parameter
return processZapiConfigCounters(path)
})
zapiPerfCounters := visitZapiTemplates("conf/zapiperf/cdot", client, func(path string, client *zapi.Client) map[string]Counter {
Expand Down Expand Up @@ -539,7 +539,7 @@ func processZapiConfigCounters(path string) map[string]Counter {

func visitRestTemplates(dir string, client *rest.Client, eachTemp func(path string, client *rest.Client) map[string]Counter) map[string]Counter {
result := make(map[string]Counter)
err := filepath.Walk(dir, func(path string, info os.FileInfo, err error) error {
err := filepath.Walk(dir, func(path string, _ os.FileInfo, err error) error {
if err != nil {
log.Fatal("failed to read directory:", err)
}
Expand All @@ -566,7 +566,7 @@ func visitRestTemplates(dir string, client *rest.Client, eachTemp func(path stri

func visitZapiTemplates(dir string, client *zapi.Client, eachTemp func(path string, client *zapi.Client) map[string]Counter) map[string]Counter {
result := make(map[string]Counter)
err := filepath.Walk(dir, func(path string, info os.FileInfo, err error) error {
err := filepath.Walk(dir, func(path string, _ os.FileInfo, err error) error {
if err != nil {
log.Fatal("failed to read directory:", err)
}
Expand Down Expand Up @@ -784,7 +784,7 @@ func processRestPerfCounters(path string, client *rest.Client) map[string]Counte
} else {
return nil
}
counterSchema.ForEach(func(key, r gjson.Result) bool {
counterSchema.ForEach(func(_, r gjson.Result) bool {
if !r.IsObject() {
return true
}
Expand Down
2 changes: 1 addition & 1 deletion cmd/tools/generate/generate.go
Original file line number Diff line number Diff line change
Expand Up @@ -606,7 +606,7 @@ func generateDescription(dPath string, data []byte, counters map[string]Counter)
return
}

grafana.VisitAllPanels(data, func(path string, key, value gjson.Result) {
grafana.VisitAllPanels(data, func(path string, _, value gjson.Result) {
kind := value.Get("type").String()
if kind == "row" || kind == "text" {
return
Expand Down
Loading
Loading