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:
@@ -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)
|
||||
}
|
||||
|
Reference in New Issue
Block a user