mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-07 20:21:20 +00:00
Add TypeAccessor to api/meta for objects without Object/ListMeta
Adding objects that have TypeMeta (use runtime.Scheme) but do not expose ObjectMeta/ListMeta (because they are not Kube API objects) and wanted to get the simpler access path for in memory objects.
This commit is contained in:
@@ -360,6 +360,9 @@ func (s *Scheme) Decode(data []byte) (Object, error) {
|
||||
// pointer to an api type.
|
||||
// If obj's APIVersion doesn't match that in data, an attempt will be made to convert
|
||||
// data into obj's version.
|
||||
// TODO: allow Decode/DecodeInto to take a default apiVersion and a default kind, to
|
||||
// be applied if the provided object does not have either field (integrate external
|
||||
// apis into the decoding scheme).
|
||||
func (s *Scheme) DecodeInto(data []byte, obj Object) error {
|
||||
return s.raw.DecodeInto(data, obj)
|
||||
}
|
||||
|
Reference in New Issue
Block a user