Skip to content

Commit

Permalink
fix golangci-lint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
kobzonega committed Sep 30, 2024
1 parent 11e4357 commit e90c04e
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 8 deletions.
19 changes: 13 additions & 6 deletions pkg/options/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,13 @@ import (
"time"
)

const (
equalSign = "=="
notEqualSign = "!="
lessThanSign = "<"
greaterThanSign = ">"
)

var AvailabilityModes = []string{"strong", "weak", "force"}

type StartedTime struct {
Expand Down Expand Up @@ -44,23 +51,23 @@ func compareMajorMinorPatch(sign string, nodeVersion, userVersion [3]int) bool {
}

switch sign {
case "==":
case equalSign:
return res == 0
case "<":
case lessThanSign:
return res == -1
case ">":
case greaterThanSign:
return res == 1
case "!=":
case notEqualSign:
return res != 0
}
return false
}

func compareRaw(sign string, nodeVersion, userVersion string) bool {
switch sign {
case "==":
case equalSign:
return nodeVersion == userVersion
case "!=":
case notEqualSign:
return nodeVersion != userVersion
}
return false
Expand Down
4 changes: 2 additions & 2 deletions pkg/rolling/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -187,9 +187,9 @@ after that would be considered a regular cluster failure`)

fs.StringVar(&versionUnparsedFlag, "version", "",
`Apply filter by node version.
Format: [(<|>|!=|~=)MAJOR.MINOR.PATCH|==VERSION_STRING], e.g.:
Format: [(<|>|!=|~=)MAJOR.MINOR.PATCH|(==|!=)VERSION_STRING], e.g.:
'--version ~=24.1.2' or
'--version ==24.1.2-ydb-stable-hotfix-5'`)
'--version !=24.1.2-ydb-stable-hotfix-5'`)

fs.BoolVar(&o.Continue, "continue", false,
`Attempt to continue previous rolling restart, if there was one. The set of selected nodes
Expand Down

0 comments on commit e90c04e

Please sign in to comment.