Replace automatic YAML decoding with opt-in YAML decoding

Base codecs no longer automically handle YAML.  Instead, clients
must convert to JSON first via yaml.ToJSON and runtime.YAMLDecoder.
This commit is contained in:
Clayton Coleman
2015-03-16 23:43:59 -04:00
parent 71abc99dbe
commit 6918a4d32e
7 changed files with 49 additions and 40 deletions

View File

@@ -196,7 +196,7 @@ func testPrinter(t *testing.T, printer ResourcePrinter, unmarshalFunc func(data
}
// Use real decode function to undo the versioning process.
poutput = testStruct{}
err = testapi.Codec().DecodeInto(buf.Bytes(), &poutput)
err = runtime.YAMLDecoder(testapi.Codec()).DecodeInto(buf.Bytes(), &poutput)
if err != nil {
t.Fatal(err)
}
@@ -217,7 +217,7 @@ func testPrinter(t *testing.T, printer ResourcePrinter, unmarshalFunc func(data
}
// Use real decode function to undo the versioning process.
objOut = api.Pod{}
err = testapi.Codec().DecodeInto(buf.Bytes(), &objOut)
err = runtime.YAMLDecoder(testapi.Codec()).DecodeInto(buf.Bytes(), &objOut)
if err != nil {
t.Fatal(err)
}