mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-08 03:33:56 +00:00
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:
parent
1795edf355
commit
6cd2fa6b42
@ -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)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user