Remove LoadContainerServiceFromAPI

This commit is contained in:
Jingtao Ren 2016-10-24 14:58:16 -07:00
Родитель 97c9f881d3
Коммит 7794ef965e
1 изменённых файлов: 0 добавлений и 24 удалений

Просмотреть файл

@ -52,27 +52,3 @@ func LoadContainerService(contents []byte) (*ContainerService, error) {
return nil, fmt.Errorf("unrecognized APIVersion '%s'", m.APIVersion)
}
}
// LoadContainerServiceFromAPI load an ACS Cluster API Model, validate it, and return the unversioned representation
func LoadContainerServiceFromAPI(api interface{}) (*ContainerService, error) {
m, found := api.(*TypeMeta)
if !found {
return nil, fmt.Errorf("no APIVersion field")
}
switch m.APIVersion {
case v20160330.APIVersion:
if e := api.(*v20160330.ContainerService).Properties.Validate(); e != nil {
return nil, e
}
return ConvertV20160330ContainerService(api.(*v20160330.ContainerService)), nil
case vlabs.APIVersion:
if e := api.(*vlabs.ContainerService).Properties.Validate(); e != nil {
return nil, e
}
return ConvertVLabsContainerService(api.(*vlabs.ContainerService)), nil
default:
return nil, fmt.Errorf("unrecognized APIVersion '%s'", m.APIVersion)
}
}