massive changes

This commit is contained in:
Chao Xu
2015-09-10 12:30:47 -07:00
parent 347ce513cc
commit dd6c121d7f
51 changed files with 203 additions and 198 deletions

View File

@@ -290,9 +290,9 @@ func SetKubernetesDefaults(config *Config) error {
config.Version = defaultVersionFor(config)
}
version := config.Version
versionInterfaces, err := latest.InterfacesFor(version)
versionInterfaces, err := latest.GroupOrDie("").InterfacesFor(version)
if err != nil {
return fmt.Errorf("API version '%s' is not recognized (valid values: %s)", version, strings.Join(latest.Versions, ", "))
return fmt.Errorf("API version '%s' is not recognized (valid values: %s)", version, strings.Join(latest.GroupOrDie("").Versions, ", "))
}
if config.Codec == nil {
config.Codec = versionInterfaces.Codec
@@ -543,7 +543,7 @@ func defaultVersionFor(config *Config) string {
if version == "" {
// Clients default to the preferred code API version
// TODO: implement version negotiation (highest version supported by server)
version = latest.Version
version = latest.GroupOrDie("").Version
}
return version
}