Skip to content

Commit 2bc2edd

Browse files
committed
Fixed lint issues
Signed-off-by: Shmuel Kallner <kallner@il.ibm.com>
1 parent b0bb7bf commit 2bc2edd

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

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
)
@@ -144,11 +145,12 @@ func (fg FeatureGates) String() string {
144145
return "{}"
145146
}
146147

147-
result := ""
148+
builder := strings.Builder{}
148149
for _, gate := range fg {
149-
result += gate + ","
150+
builder.WriteString(gate + ",")
150151
}
151152

153+
result := builder.String()
152154
if len(result) > 0 {
153155
result = result[:len(result)-1]
154156
}

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)