mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-22 19:31:44 +00:00
don't use string(index)
This commit is contained in:
parent
6d09ba41e9
commit
99d8868c7c
@ -20,6 +20,7 @@ import (
|
|||||||
"encoding/json"
|
"encoding/json"
|
||||||
"fmt"
|
"fmt"
|
||||||
"math/rand"
|
"math/rand"
|
||||||
|
"net/http"
|
||||||
"strconv"
|
"strconv"
|
||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
@ -32,7 +33,6 @@ import (
|
|||||||
k8sruntime "k8s.io/kubernetes/pkg/runtime"
|
k8sruntime "k8s.io/kubernetes/pkg/runtime"
|
||||||
"k8s.io/kubernetes/pkg/util"
|
"k8s.io/kubernetes/pkg/util"
|
||||||
"k8s.io/kubernetes/pkg/util/strategicpatch"
|
"k8s.io/kubernetes/pkg/util/strategicpatch"
|
||||||
"net/http"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
type testEventSink struct {
|
type testEventSink struct {
|
||||||
@ -367,10 +367,10 @@ func TestEventf(t *testing.T) {
|
|||||||
// validate event
|
// validate event
|
||||||
if item.expectUpdate {
|
if item.expectUpdate {
|
||||||
actualEvent := <-patchEvent
|
actualEvent := <-patchEvent
|
||||||
validateEvent(string(index), actualEvent, item.expect, t)
|
validateEvent(strconv.Itoa(index), actualEvent, item.expect, t)
|
||||||
} else {
|
} else {
|
||||||
actualEvent := <-createEvent
|
actualEvent := <-createEvent
|
||||||
validateEvent(string(index), actualEvent, item.expect, t)
|
validateEvent(strconv.Itoa(index), actualEvent, item.expect, t)
|
||||||
}
|
}
|
||||||
// TODO: uncomment this after we upgrade to Go 1.6.1.
|
// TODO: uncomment this after we upgrade to Go 1.6.1.
|
||||||
// logWatcher1.Stop()
|
// logWatcher1.Stop()
|
||||||
@ -618,10 +618,10 @@ func TestEventfNoNamespace(t *testing.T) {
|
|||||||
// validate event
|
// validate event
|
||||||
if item.expectUpdate {
|
if item.expectUpdate {
|
||||||
actualEvent := <-patchEvent
|
actualEvent := <-patchEvent
|
||||||
validateEvent(string(index), actualEvent, item.expect, t)
|
validateEvent(strconv.Itoa(index), actualEvent, item.expect, t)
|
||||||
} else {
|
} else {
|
||||||
actualEvent := <-createEvent
|
actualEvent := <-createEvent
|
||||||
validateEvent(string(index), actualEvent, item.expect, t)
|
validateEvent(strconv.Itoa(index), actualEvent, item.expect, t)
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: uncomment this after we upgrade to Go 1.6.1.
|
// TODO: uncomment this after we upgrade to Go 1.6.1.
|
||||||
@ -898,10 +898,10 @@ func TestMultiSinkCache(t *testing.T) {
|
|||||||
// validate event
|
// validate event
|
||||||
if item.expectUpdate {
|
if item.expectUpdate {
|
||||||
actualEvent := <-patchEvent
|
actualEvent := <-patchEvent
|
||||||
validateEvent(string(index), actualEvent, item.expect, t)
|
validateEvent(strconv.Itoa(index), actualEvent, item.expect, t)
|
||||||
} else {
|
} else {
|
||||||
actualEvent := <-createEvent
|
actualEvent := <-createEvent
|
||||||
validateEvent(string(index), actualEvent, item.expect, t)
|
validateEvent(strconv.Itoa(index), actualEvent, item.expect, t)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -914,10 +914,10 @@ func TestMultiSinkCache(t *testing.T) {
|
|||||||
// validate event
|
// validate event
|
||||||
if item.expectUpdate {
|
if item.expectUpdate {
|
||||||
actualEvent := <-patchEvent2
|
actualEvent := <-patchEvent2
|
||||||
validateEvent(string(index), actualEvent, item.expect, t)
|
validateEvent(strconv.Itoa(index), actualEvent, item.expect, t)
|
||||||
} else {
|
} else {
|
||||||
actualEvent := <-createEvent2
|
actualEvent := <-createEvent2
|
||||||
validateEvent(string(index), actualEvent, item.expect, t)
|
validateEvent(strconv.Itoa(index), actualEvent, item.expect, t)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user