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

@@ -458,6 +458,10 @@ func (s *Scheme) DecodeInto(data []byte, obj Object) error {
return s.raw.DecodeInto(data, obj)
}
func (s *Scheme) DecodeIntoWithSpecifiedVersionKind(data []byte, obj Object, version, kind string) error {
return s.raw.DecodeIntoWithSpecifiedVersionKind(data, obj, version, kind)
}
// Copy does a deep copy of an API object. Useful mostly for tests.
func (s *Scheme) Copy(src Object) (Object, error) {
dst, err := s.raw.DeepCopy(src)