Merge pull request #25876 from kolyshkin/golangci-v2-fup1

ci: fix two issues, remove unused exceptions
This commit is contained in:
openshift-merge-bot[bot] 2025-04-16 13:21:24 +00:00 committed by GitHub
commit ae63e2c932
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 3 additions and 5 deletions

View File

@ -69,8 +69,6 @@ linters:
generated: strict generated: strict
presets: presets:
- comments - comments
- common-false-positives
- legacy
- std-error-handling - std-error-handling
rules: rules:
- linters: - linters:

View File

@ -233,17 +233,17 @@ func create(cmd *cobra.Command, args []string) error {
} }
} }
sort.Ints(vals) sort.Ints(vals)
loop:
for ind, core := range vals { for ind, core := range vals {
switch { switch {
case core > int(cpuSet): case core > int(cpuSet):
if copy == "" { if copy == "" {
copy = "0-" + strconv.Itoa(int(cpuSet)) copy = "0-" + strconv.Itoa(int(cpuSet))
infraOptions.CPUSetCPUs = copy infraOptions.CPUSetCPUs = copy
break
} else { } else {
infraOptions.CPUSetCPUs = copy infraOptions.CPUSetCPUs = copy
break
} }
break loop
case ind != 0: case ind != 0:
copy += "," + strconv.Itoa(core) copy += "," + strconv.Itoa(core)
default: default:
@ -252,6 +252,7 @@ func create(cmd *cobra.Command, args []string) error {
} }
createOptions.Cpus = infraOptions.CPUS createOptions.Cpus = infraOptions.CPUS
createOptions.CpusetCpus = infraOptions.CPUSetCPUs createOptions.CpusetCpus = infraOptions.CPUSetCPUs
podSpec := specgen.NewPodSpecGenerator() podSpec := specgen.NewPodSpecGenerator()
podSpec, err = entities.ToPodSpecGen(*podSpec, &createOptions) podSpec, err = entities.ToPodSpecGen(*podSpec, &createOptions)
if err != nil { if err != nil {

View File

@ -48,7 +48,6 @@ func notifyWinChange(ctx context.Context, winChange chan os.Signal, stdin *os.Fi
case <-ctx.Done(): case <-ctx.Done():
return return
case <-timer.C: case <-timer.C:
break
} }
w, h, err := term.GetSize(int(stdout.Fd())) w, h, err := term.GetSize(int(stdout.Fd()))