mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-09-24 16:03:43 +08:00
Automatic merge from release/2.5.0 -> release/2.6.0
* commit 'fef1f193a10cc7fd15e78a7b161c885bbf215e4b': image os type caseinsensitive
This commit is contained in:
@@ -463,7 +463,7 @@ func (this *ImageManager) _create(s *mcclient.ClientSession, params jsonutils.JS
|
||||
if err != nil {
|
||||
return nil, httperrors.NewMissingParameterError("os_type")
|
||||
}
|
||||
if !utils.IsInStringArray(osType, []string{"Windows", "Linux", "Freebsd", "Android", "macOS", "VMWare"}) {
|
||||
if !utils.IsInStringArray(strings.ToLower(osType), []string{"windows", "linux", "freebsd", "android", "macos", "vmware"}) {
|
||||
return nil, fmt.Errorf("OS type must be specified")
|
||||
}
|
||||
name, _ := params.GetString("name")
|
||||
|
||||
Reference in New Issue
Block a user