mirror of
https://github.com/kubernetes/client-go.git
synced 2025-06-29 08:29:23 +00:00
Merge pull request #93425 from liggitt/string-cast
Fix int->string casts Kubernetes-commit: 19caf386650b80ce9d288cc8c42efcf2f0fd87b1
This commit is contained in:
commit
6b13c5bd95
@ -185,7 +185,7 @@ func TestAzureTokenSource(t *testing.T) {
|
|||||||
expiresOn = "foo"
|
expiresOn = "foo"
|
||||||
)
|
)
|
||||||
cfg := map[string]string{
|
cfg := map[string]string{
|
||||||
cfgConfigMode: string(configMode),
|
cfgConfigMode: strconv.Itoa(int(configMode)),
|
||||||
cfgApiserverID: serverID,
|
cfgApiserverID: serverID,
|
||||||
cfgClientID: clientID,
|
cfgClientID: clientID,
|
||||||
cfgTenantID: tenantID,
|
cfgTenantID: tenantID,
|
||||||
@ -365,7 +365,7 @@ func TestAzureTokenSourceScenarios(t *testing.T) {
|
|||||||
persister := newFakePersister()
|
persister := newFakePersister()
|
||||||
|
|
||||||
cfg := map[string]string{
|
cfg := map[string]string{
|
||||||
cfgConfigMode: string(configMode),
|
cfgConfigMode: strconv.Itoa(int(configMode)),
|
||||||
}
|
}
|
||||||
if tc.configToken != nil {
|
if tc.configToken != nil {
|
||||||
cfg = token2Cfg(tc.configToken)
|
cfg = token2Cfg(tc.configToken)
|
||||||
|
@ -24,7 +24,7 @@ import (
|
|||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"k8s.io/api/core/v1"
|
v1 "k8s.io/api/core/v1"
|
||||||
"k8s.io/apimachinery/pkg/api/errors"
|
"k8s.io/apimachinery/pkg/api/errors"
|
||||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||||
k8sruntime "k8s.io/apimachinery/pkg/runtime"
|
k8sruntime "k8s.io/apimachinery/pkg/runtime"
|
||||||
@ -509,7 +509,7 @@ func TestLotsOfEvents(t *testing.T) {
|
|||||||
APIVersion: "version",
|
APIVersion: "version",
|
||||||
}
|
}
|
||||||
// we need to vary the reason to prevent aggregation
|
// we need to vary the reason to prevent aggregation
|
||||||
go recorder.Eventf(ref, v1.EventTypeNormal, "Reason-"+string(i), strconv.Itoa(i))
|
go recorder.Eventf(ref, v1.EventTypeNormal, "Reason-"+strconv.Itoa(i), strconv.Itoa(i))
|
||||||
}
|
}
|
||||||
// Make sure no events were dropped by either of the listeners.
|
// Make sure no events were dropped by either of the listeners.
|
||||||
for i := 0; i < maxQueuedEvents; i++ {
|
for i := 0; i < maxQueuedEvents; i++ {
|
||||||
|
@ -18,6 +18,7 @@ package record
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"reflect"
|
"reflect"
|
||||||
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
@ -69,10 +70,10 @@ func makeUniqueEvents(num int) []v1.Event {
|
|||||||
events := []v1.Event{}
|
events := []v1.Event{}
|
||||||
kind := "Pod"
|
kind := "Pod"
|
||||||
for i := 0; i < num; i++ {
|
for i := 0; i < num; i++ {
|
||||||
reason := strings.Join([]string{"reason", string(i)}, "-")
|
reason := strings.Join([]string{"reason", strconv.Itoa(i)}, "-")
|
||||||
message := strings.Join([]string{"message", string(i)}, "-")
|
message := strings.Join([]string{"message", strconv.Itoa(i)}, "-")
|
||||||
name := strings.Join([]string{"pod", string(i)}, "-")
|
name := strings.Join([]string{"pod", strconv.Itoa(i)}, "-")
|
||||||
namespace := strings.Join([]string{"ns", string(i)}, "-")
|
namespace := strings.Join([]string{"ns", strconv.Itoa(i)}, "-")
|
||||||
involvedObject := makeObjectReference(kind, name, namespace)
|
involvedObject := makeObjectReference(kind, name, namespace)
|
||||||
events = append(events, makeEvent(reason, message, involvedObject))
|
events = append(events, makeEvent(reason, message, involvedObject))
|
||||||
}
|
}
|
||||||
@ -82,7 +83,7 @@ func makeUniqueEvents(num int) []v1.Event {
|
|||||||
func makeSimilarEvents(num int, template v1.Event, messagePrefix string) []v1.Event {
|
func makeSimilarEvents(num int, template v1.Event, messagePrefix string) []v1.Event {
|
||||||
events := makeEvents(num, template)
|
events := makeEvents(num, template)
|
||||||
for i := range events {
|
for i := range events {
|
||||||
events[i].Message = strings.Join([]string{messagePrefix, string(i), events[i].Message}, "-")
|
events[i].Message = strings.Join([]string{messagePrefix, strconv.Itoa(i), events[i].Message}, "-")
|
||||||
}
|
}
|
||||||
return events
|
return events
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user