Skip to content

Commit

Permalink
Fix linters
Browse files Browse the repository at this point in the history
Signed-off-by: Raul Sevilla <rsevilla@redhat.com>
  • Loading branch information
rsevilla87 committed Nov 17, 2022
1 parent 24095ef commit a015c19
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 10 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/kube-burner.yml
Expand Up @@ -26,6 +26,8 @@ jobs:
id: go

- uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Build
run: make build
Expand Down
8 changes: 2 additions & 6 deletions .golangci.yml
Expand Up @@ -7,19 +7,15 @@ linters:
disable-all: true
enable:
- nakedret
- varcheck
- deadcode
- structcheck
- unused
- misspell
- ineffassign
- goconst
- goimports
- dupl
- unparam
- golint
- revive
- staticcheck
- unused
- gosimple
- unconvert
- gocyclo
- structcheck
2 changes: 2 additions & 0 deletions pkg/burner/job.go
Expand Up @@ -26,6 +26,7 @@ import (
"github.com/cloud-bulldozer/kube-burner/pkg/measurements"
"github.com/cloud-bulldozer/kube-burner/pkg/prometheus"
"github.com/cloud-bulldozer/kube-burner/pkg/util"
"github.com/cloud-bulldozer/kube-burner/pkg/version"
"golang.org/x/time/rate"
"k8s.io/apimachinery/pkg/runtime/schema"

Expand Down Expand Up @@ -78,6 +79,7 @@ func Run(configSpec config.Spec, uuid string, p *prometheus.Prometheus, alertM *
var err error
var measurementsWg sync.WaitGroup
var indexer *indexers.Indexer
log.Infof("🔥 Starting kube-burner (%s@%s) with UUID %s", version.Version, version.GitCommit, uuid)
if configSpec.GlobalConfig.IndexerConfig.Enabled {
indexer, err = indexers.NewIndexer(configSpec)
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion pkg/burner/pre_load.go
Expand Up @@ -28,7 +28,7 @@ import (
"k8s.io/apimachinery/pkg/runtime"
)

var preLoadNs string = "preload-kube-burner"
const preLoadNs = "preload-kube-burner"

// NestedPod represents a pod nested in a higher level object such as deployment or a daemonset
type NestedPod struct {
Expand Down
2 changes: 1 addition & 1 deletion pkg/config/config.go
Expand Up @@ -38,7 +38,7 @@ import (
"k8s.io/client-go/tools/clientcmd"
)

var configSpec Spec = Spec{
var configSpec = Spec{
GlobalConfig: GlobalConfig{
MetricsDirectory: "collected-metrics",
RequestTimeout: 15 * time.Second,
Expand Down
2 changes: 1 addition & 1 deletion pkg/measurements/pod_latency.go
Expand Up @@ -224,7 +224,7 @@ func (p *podLatency) calcQuantiles() {

func (p *podLatency) validateConfig() error {
var metricFound bool
var latencyMetrics []string = []string{"P99", "P95", "P50", "Avg", "Max"}
var latencyMetrics = []string{"P99", "P95", "P50", "Avg", "Max"}
for _, th := range p.config.LatencyThresholds {
if th.ConditionType == string(v1.ContainersReady) || th.ConditionType == string(v1.PodInitialized) || th.ConditionType == string(v1.PodReady) || th.ConditionType == string(v1.PodScheduled) {
for _, lm := range latencyMetrics {
Expand Down
2 changes: 1 addition & 1 deletion pkg/measurements/vmi_latency.go
Expand Up @@ -460,7 +460,7 @@ func (p *vmiLatency) calcQuantiles() {

func (p *vmiLatency) validateConfig() error {
var metricFound bool
var latencyMetrics []string = []string{"P99", "P95", "P50", "Avg", "Max"}
var latencyMetrics = []string{"P99", "P95", "P50", "Avg", "Max"}
for _, th := range p.config.LatencyThresholds {
if th.ConditionType == string(kvv1.Pending) ||
th.ConditionType == string(kvv1.Scheduling) ||
Expand Down

0 comments on commit a015c19

Please sign in to comment.