Skip to content

Commit 21a17c0

Browse files
committed
bump golangci-lint and fix new lint issues
1 parent 9ddafd8 commit 21a17c0

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ PROG := cluster-image-registry-operator
44

55
GOLANGCI_LINT = _output/tools/golangci-lint
66
GOLANGCI_LINT_CACHE = $(PWD)/_output/golangci-lint-cache
7-
GOLANGCI_LINT_VERSION = v1.56.2
7+
GOLANGCI_LINT_VERSION = v1.64.8
88

99
GO_REQUIRED_MIN_VERSION = 1.16
1010

pkg/operator/status.go

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package operator
22

33
import (
4+
"errors"
45
"fmt"
56
"strings"
67
"time"
@@ -221,7 +222,7 @@ func (c *ImagePrunerController) syncPrunerStatus(cr *imageregistryv1.ImagePruner
221222
// checkRoutesStatus verifies the Admitted condition type for all provided routes,
222223
// returns an error if any of them was not admitted.
223224
func (c *Controller) checkRoutesStatus(routes []*routev1.Route) error {
224-
var errors []string
225+
var errs []string
225226
for _, route := range routes {
226227
for _, ingress := range route.Status.Ingress {
227228
for _, condition := range ingress.Conditions {
@@ -231,8 +232,8 @@ func (c *Controller) checkRoutesStatus(routes []*routev1.Route) error {
231232
if condition.Status == corev1.ConditionTrue {
232233
continue
233234
}
234-
errors = append(
235-
errors,
235+
errs = append(
236+
errs,
236237
fmt.Sprintf(
237238
"route %s (host %s, router %s) not admitted: %s",
238239
route.Name,
@@ -244,8 +245,8 @@ func (c *Controller) checkRoutesStatus(routes []*routev1.Route) error {
244245
}
245246
}
246247
}
247-
if len(errors) > 0 {
248-
return fmt.Errorf(strings.Join(errors, ","))
248+
if len(errs) > 0 {
249+
return errors.New(strings.Join(errs, ","))
249250
}
250251
return nil
251252
}

0 commit comments

Comments
 (0)