Rename Codec and ResourceVersioner to add Default in front, to allow for types of those names

This commit is contained in:
Daniel Smith
2014-09-05 18:47:09 -07:00
parent 828b70abb9
commit 1c2b65788d
29 changed files with 121 additions and 96 deletions

View File

@@ -103,7 +103,7 @@ func TestApiExamples(t *testing.T) {
return
}
tested += 1
if err := runtime.DecodeInto(data, expectedType); err != nil {
if err := runtime.DefaultCodec.DecodeInto(data, expectedType); err != nil {
t.Errorf("%s did not decode correctly: %v\n%s", path, err, string(data))
return
}
@@ -137,7 +137,7 @@ func TestExamples(t *testing.T) {
return
}
tested += 1
if err := runtime.DecodeInto(data, expectedType); err != nil {
if err := runtime.DefaultCodec.DecodeInto(data, expectedType); err != nil {
t.Errorf("%s did not decode correctly: %v\n%s", path, err, string(data))
return
}
@@ -168,14 +168,14 @@ func TestReadme(t *testing.T) {
}
for _, json := range match[1:] {
expectedType := &api.Pod{}
if err := runtime.DecodeInto([]byte(json), expectedType); err != nil {
if err := runtime.DefaultCodec.DecodeInto([]byte(json), expectedType); err != nil {
t.Errorf("%s did not decode correctly: %v\n%s", path, err, string(data))
return
}
if errors := validateObject(expectedType); len(errors) > 0 {
t.Errorf("%s did not validate correctly: %v", path, errors)
}
encoded, err := runtime.Encode(expectedType)
encoded, err := runtime.DefaultCodec.Encode(expectedType)
if err != nil {
t.Errorf("Could not encode object: %v", err)
continue