To be compatible with release 1.1, decode Status even if the APIVersion is not set.

This commit is contained in:
Chao Xu
2016-02-04 13:51:37 -08:00
parent 59820827d4
commit 0d772a7a52
2 changed files with 12 additions and 5 deletions

View File

@@ -109,7 +109,11 @@ func TestDoRequestFailed(t *testing.T) {
t.Errorf("unexpected error type %v", err)
}
actual := ss.Status()
if !reflect.DeepEqual(status, &actual) {
expected := *status
// The decoder will apply the default Version and Kind to the Status.
expected.APIVersion = "v1"
expected.Kind = "Status"
if !reflect.DeepEqual(&expected, &actual) {
t.Errorf("Unexpected mis-match: %s", util.ObjectDiff(status, &actual))
}
}