Commit 6cd2fa6b authored by Kris's avatar Kris

Make unstructured scheme aware of VersionedObjects

UnstructuredJSONScheme now handles decoding into VersionedObjects properly by decoding into Unstructured and putting it in the object list.
parent 1795edf3
......@@ -98,6 +98,13 @@ func (s unstructuredJSONScheme) decodeInto(data []byte, obj Object) error {
return s.decodeToUnstructured(data, x)
case *UnstructuredList:
return s.decodeToList(data, x)
case *VersionedObjects:
u := new(Unstructured)
err := s.decodeToUnstructured(data, u)
if err == nil {
x.Objects = []Object{u}
}
return err
default:
return json.Unmarshal(data, x)
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment