mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-31 15:25:57 +00:00
commit
ceaddc0c44
@ -149,7 +149,7 @@ func TestNewInvalid(t *testing.T) {
|
|||||||
}
|
}
|
||||||
for i, testCase := range testCases {
|
for i, testCase := range testCases {
|
||||||
vErr, expected := testCase.Err, testCase.Details
|
vErr, expected := testCase.Err, testCase.Details
|
||||||
expected.Causes[0].Message = vErr.Error()
|
expected.Causes[0].Message = vErr.ErrorBody()
|
||||||
err := NewInvalid("kind", "name", fielderrors.ValidationErrorList{vErr})
|
err := NewInvalid("kind", "name", fielderrors.ValidationErrorList{vErr})
|
||||||
status := err.(*StatusError).ErrStatus
|
status := err.(*StatusError).ErrStatus
|
||||||
if status.Code != 422 || status.Reason != api.StatusReasonInvalid {
|
if status.Code != 422 || status.Reason != api.StatusReasonInvalid {
|
||||||
|
@ -316,7 +316,7 @@ func validateEvent(actualEvent *api.Event, expectedEvent *api.Event, t *testing.
|
|||||||
if actualEvent.FirstTimestamp.IsZero() || actualEvent.LastTimestamp.IsZero() {
|
if actualEvent.FirstTimestamp.IsZero() || actualEvent.LastTimestamp.IsZero() {
|
||||||
t.Errorf("timestamp wasn't set: %#v", *actualEvent)
|
t.Errorf("timestamp wasn't set: %#v", *actualEvent)
|
||||||
}
|
}
|
||||||
if actualEvent.FirstTimestamp.Equal(actualEvent.LastTimestamp.Time) {
|
if actualEvent.FirstTimestamp.Equal(actualEvent.LastTimestamp) {
|
||||||
if expectCompression {
|
if expectCompression {
|
||||||
t.Errorf("FirstTimestamp (%q) and LastTimestamp (%q) must be equal to indicate only one occurance of the event, but were different. Actual Event: %#v", actualEvent.FirstTimestamp, actualEvent.LastTimestamp, *actualEvent)
|
t.Errorf("FirstTimestamp (%q) and LastTimestamp (%q) must be equal to indicate only one occurance of the event, but were different. Actual Event: %#v", actualEvent.FirstTimestamp, actualEvent.LastTimestamp, *actualEvent)
|
||||||
}
|
}
|
||||||
|
@ -173,7 +173,7 @@ func compareEventWithHistoryEntry(expected *api.Event, actual *history, t *testi
|
|||||||
t.Fatalf("There should be one existing instance of this event in the hash table.")
|
t.Fatalf("There should be one existing instance of this event in the hash table.")
|
||||||
}
|
}
|
||||||
|
|
||||||
if !actual.FirstTimestamp.Equal(expected.FirstTimestamp.Time) {
|
if !actual.FirstTimestamp.Equal(expected.FirstTimestamp) {
|
||||||
t.Fatalf("Unexpected FirstTimestamp. Expected: <%v> Actual: <%v>", expected.FirstTimestamp, actual.FirstTimestamp)
|
t.Fatalf("Unexpected FirstTimestamp. Expected: <%v> Actual: <%v>", expected.FirstTimestamp, actual.FirstTimestamp)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1136,7 +1136,7 @@ func TestOverlappingRCs(t *testing.T) {
|
|||||||
controllers = append(controllers, controllerSpec)
|
controllers = append(controllers, controllerSpec)
|
||||||
}
|
}
|
||||||
shuffledControllers := shuffle(controllers)
|
shuffledControllers := shuffle(controllers)
|
||||||
for j, _ := range shuffledControllers {
|
for j := range shuffledControllers {
|
||||||
manager.controllerStore.Store.Add(shuffledControllers[j])
|
manager.controllerStore.Store.Add(shuffledControllers[j])
|
||||||
}
|
}
|
||||||
// Add a pod and make sure only the oldest rc is synced
|
// Add a pod and make sure only the oldest rc is synced
|
||||||
|
Loading…
Reference in New Issue
Block a user