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

Fix golangci-lint precommit hook #100

Merged
merged 3 commits into from
Sep 17, 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
1 change: 0 additions & 1 deletion .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ linters:
- goimports
- dupl
- unparam
- revive
- staticcheck
- gosimple
- unconvert
Expand Down
3 changes: 2 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
repos:
- repo: https://github.com/golangci/golangci-lint
rev: v1.58.1
rev: v1.60.3
hooks:
- id: golangci-lint
entry: golangci-lint run
args: [--timeout=5m]
- repo: https://github.com/igorshubovych/markdownlint-cli
rev: v0.34.0
Expand Down
2 changes: 1 addition & 1 deletion cluster_health.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ func clusterImageRegistryCheck(clientset kubernetes.Interface) bool {
return false
}
if deployment.Status.AvailableReplicas > 0 {
log.Debugf("Deployment image-regsitry in namespace openshift-image-registry is available with %d replicas", deployment.Status.AvailableReplicas)
log.Debugf("Deployment image-registry in namespace openshift-image-registry is available with %d replicas", deployment.Status.AvailableReplicas)
return true
}
return false
Expand Down
6 changes: 2 additions & 4 deletions egressip.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,19 +102,18 @@ func getFirstUsableAddr(cidr string) uint32 {
baseAddrInt, err := ipconv.IPv4ToInt(firstUsableIP)
if err != nil {
log.Fatal("Error converting IP to int: ", err)
os.Exit(1)
}
return baseAddrInt
}

// egress IPs and node IPs will be in same cidr. So we need to exclude node IPs from CIDR to generate list of avaialble egress IPs.
// egress IPs and node IPs will be in same cidr. So we need to exclude node IPs from CIDR to generate list of available egress IPs.
func generateEgressIPs(numJobIterations int, addressesPerIteration int, externalServerIP string) {

nodeIPs, egressIPCidr := getEgressIPCidrNodeIPs()
// Add external server ip to nodeIPs to get excluded while creating egress ip list
nodeIPs = append(nodeIPs, externalServerIP)
baseAddrInt := getFirstUsableAddr(egressIPCidr)
// list to host avaialble egress IPs
// list to host available egress IPs
addrSlice := make([]string, 0, (numJobIterations * addressesPerIteration))

// map to store nodeIPs
Expand All @@ -123,7 +122,6 @@ func generateEgressIPs(numJobIterations int, addressesPerIteration int, external
nodeipuint32, err := ipconv.IPv4ToInt(net.ParseIP(nodeip))
if err != nil {
log.Fatal("Error: ", err)
os.Exit(1)
}
nodeMap[nodeipuint32] = true
}
Expand Down
20 changes: 10 additions & 10 deletions index.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,17 @@
package ocp

import (
"encoding/json"
"fmt"
"os"
"strings"
"encoding/json"
"time"
"fmt"

"github.com/cloud-bulldozer/go-commons/indexers"
"github.com/cloud-bulldozer/go-commons/version"
ocpmetadata "github.com/cloud-bulldozer/go-commons/ocp-metadata"
"github.com/kube-burner/kube-burner/pkg/config"
"github.com/cloud-bulldozer/go-commons/version"
"github.com/kube-burner/kube-burner/pkg/burner"
"github.com/kube-burner/kube-burner/pkg/config"
"github.com/kube-burner/kube-burner/pkg/prometheus"
"github.com/kube-burner/kube-burner/pkg/util/metrics"
"github.com/kube-burner/kube-burner/pkg/workloads"
Expand Down Expand Up @@ -133,17 +133,17 @@ func NewIndex(metricsEndpoint *string, ocpMetaAgent *ocpmetadata.Metadata) *cobr
break
}
jobSummary := burner.JobSummary{
Timestamp: time.Unix(start, 0).UTC(),
Timestamp: time.Unix(start, 0).UTC(),
EndTimestamp: time.Unix(end, 0).UTC(),
ElapsedTime: time.Unix(end, 0).UTC().Sub(time.Unix(start, 0).UTC()).Round(time.Second).Seconds(),
UUID: uuid,
ElapsedTime: time.Unix(end, 0).UTC().Sub(time.Unix(start, 0).UTC()).Round(time.Second).Seconds(),
UUID: uuid,
JobConfig: config.Job{
Name: jobName,
},
Metadata: metricsScraper.Metadata,
Metadata: metricsScraper.Metadata,
MetricName: "jobSummary",
Version: fmt.Sprintf("%v@%v", version.Version, version.GitCommit),
Passed: rc == 0,
Version: fmt.Sprintf("%v@%v", version.Version, version.GitCommit),
Passed: rc == 0,
}
burner.IndexJobSummary([]burner.JobSummary{jobSummary}, indexerValue)
},
Expand Down
Loading