Adding a way to decode to a specified version.

This is largely needed as a way to get a versioned client without
requiring everyone to switch to versioned types at once.
This commit is contained in:
Kris Rousey
2015-08-07 12:45:20 -07:00
parent 213e7a8ab6
commit 6e64a63a84
7 changed files with 49 additions and 7 deletions

View File

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