Do not automatically decode runtime.RawExtension
Make clients opt in to decoding objects that are stored in the generic api.List object by invoking runtime.DecodeList() with a set of schemes. Makes it easier to handle unknown schema objects because decoding is in the control of the code. Add runtime.Unstructured, which is a simple in memory representation of an external object.
This commit is contained in:
@@ -116,3 +116,17 @@ type Unknown struct {
|
||||
}
|
||||
|
||||
func (*Unknown) IsAnAPIObject() {}
|
||||
|
||||
// Unstructured allows objects that do not have Golang structs registered to be manipulated
|
||||
// generically. This can be used to deal with the API objects from a plug-in. Unstructured
|
||||
// objects still have functioning TypeMeta features-- kind, version, etc.
|
||||
// TODO: Make this object have easy access to field based accessors and settors for
|
||||
// metadata and field mutatation.
|
||||
type Unstructured struct {
|
||||
TypeMeta `json:",inline"`
|
||||
// Object is a JSON compatible map with string, float, int, []interface{}, or map[string]interface{}
|
||||
// children.
|
||||
Object map[string]interface{}
|
||||
}
|
||||
|
||||
func (*Unstructured) IsAnAPIObject() {}
|
||||
|
Reference in New Issue
Block a user