Skip to content

Commit a9bfb1b

Browse files
authored
fix: CI golangci-lint errors (#1948)
* Upgraded golangci-lint to fix CI build errors Signed-off-by: Shmuel Kallner <kallner@il.ibm.com> * Fix lint errors Signed-off-by: Shmuel Kallner <kallner@il.ibm.com> --------- Signed-off-by: Shmuel Kallner <kallner@il.ibm.com>
1 parent cbbfd0e commit a9bfb1b

File tree

3 files changed

+11
-6
lines changed

3 files changed

+11
-6
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -406,7 +406,7 @@ KUSTOMIZE_VERSION ?= v5.4.3
406406
CONTROLLER_TOOLS_VERSION ?= v0.19.0
407407
ENVTEST_VERSION ?= release-0.19
408408
CRD_REF_DOCS_VERSION ?= v0.2.0
409-
GOLANGCI_LINT_VERSION ?= v2.3.0
409+
GOLANGCI_LINT_VERSION ?= v2.7.0
410410
HELM_VERSION ?= v3.17.1
411411
KUBECTL_VALIDATE_VERSION ?= v0.0.4
412412
GCI_VERSION ?= v0.13.6

apix/config/v1alpha1/endpointpickerconfig_types.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ package v1alpha1
1919
import (
2020
"encoding/json"
2121
"fmt"
22+
"strings"
2223

2324
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
2425
)
@@ -139,11 +140,12 @@ func (fg FeatureGates) String() string {
139140
return "{}"
140141
}
141142

142-
result := ""
143+
builder := strings.Builder{}
143144
for _, gate := range fg {
144-
result += gate + ","
145+
builder.WriteString(gate + ",")
145146
}
146147

148+
result := builder.String()
147149
if len(result) > 0 {
148150
result = result[:len(result)-1]
149151
}

conformance/utils/kubernetes/helpers.go

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ import (
2222
"context"
2323
"fmt"
2424
"reflect"
25+
"strings"
2526
"testing"
2627
"time"
2728

@@ -131,19 +132,21 @@ func InferencePoolMustHaveCondition(t *testing.T, c client.Reader, poolNN types.
131132
if len(lastObservedPool.Status.Parents) == 0 {
132133
debugMsg += " (No parent statuses reported)"
133134
}
135+
builder := strings.Builder{}
134136
for i, parentStatus := range lastObservedPool.Status.Parents {
135137
namespace := parentStatus.ParentRef.Namespace
136138
if namespace == "" {
137139
namespace = inferenceapi.Namespace(poolNN.Namespace) // Fallback to the pool's namespace
138140
}
139-
debugMsg += fmt.Sprintf("\n Parent %d (Gateway: %s/%s):", i, namespace, parentStatus.ParentRef.Name)
141+
fmt.Fprintf(&builder, "\n Parent %d (Gateway: %s/%s):", i, namespace, parentStatus.ParentRef.Name)
140142
if len(parentStatus.Conditions) == 0 {
141-
debugMsg += " (No conditions reported for this parent)"
143+
builder.WriteString(" (No conditions reported for this parent)")
142144
}
143145
for _, cond := range parentStatus.Conditions {
144-
debugMsg += fmt.Sprintf("\n - Type: %s, Status: %s, Reason: %s, Message: %s", cond.Type, cond.Status, cond.Reason, cond.Message)
146+
fmt.Fprintf(&builder, "\n - Type: %s, Status: %s, Reason: %s, Message: %s", cond.Type, cond.Status, cond.Reason, cond.Message)
145147
}
146148
}
149+
debugMsg += builder.String()
147150
} else if lastError == nil || !apierrors.IsNotFound(lastError) {
148151
debugMsg += "\nInferencePool was not found or not observed successfully during polling."
149152
}

0 commit comments

Comments
 (0)