Add DecodeIntoWithSpecifiedVersionKind() to Decoder interface.

The function validate/default the body with the passed in apiVersion and Kind.
It's called in createHandler and UpdateResource
This commit is contained in:
Chao Xu
2015-06-19 17:16:25 -07:00
parent c5bffaaf31
commit 664d20c572
8 changed files with 216 additions and 40 deletions

View File

@@ -74,6 +74,10 @@ func (unstructuredJSONScheme) DecodeInto(data []byte, obj Object) error {
return nil
}
func (unstructuredJSONScheme) DecodeIntoWithSpecifiedVersionKind(data []byte, obj Object, kind, version string) error {
return nil
}
func (unstructuredJSONScheme) DataVersionAndKind(data []byte) (version, kind string, err error) {
obj := TypeMeta{}
if err := json.Unmarshal(data, &obj); err != nil {