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:
Clayton Coleman
2015-01-18 21:22:55 -05:00
parent eeb712d163
commit 5f6caaba2e
5 changed files with 62 additions and 6 deletions

View File

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