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:
@@ -54,6 +54,10 @@ type missingKindErr struct {
|
||||
data string
|
||||
}
|
||||
|
||||
func NewMissingKindErr(data string) error {
|
||||
return &missingKindErr{data}
|
||||
}
|
||||
|
||||
func (k *missingKindErr) Error() string {
|
||||
return fmt.Sprintf("Object 'Kind' is missing in '%s'", k.data)
|
||||
}
|
||||
@@ -70,6 +74,10 @@ type missingVersionErr struct {
|
||||
data string
|
||||
}
|
||||
|
||||
func NewMissingVersionErr(data string) error {
|
||||
return &missingVersionErr{data}
|
||||
}
|
||||
|
||||
func (k *missingVersionErr) Error() string {
|
||||
return fmt.Sprintf("Object 'apiVersion' is missing in '%s'", k.data)
|
||||
}
|
||||
|
Reference in New Issue
Block a user