Make unstructured scheme aware of VersionedObjects

UnstructuredJSONScheme now handles decoding into VersionedObjects
properly by decoding into Unstructured and putting it in the object list.
This commit is contained in:
Kris 2016-05-11 15:36:08 -07:00
parent 1795edf355
commit 6cd2fa6b42

View File

@ -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)
}