fix: avoid duplicate sku error

This commit is contained in:
ioito
2019-08-16 14:41:18 +08:00
parent 471595bb82
commit 3edb0ebddb
+2 -5
View File
@@ -50,13 +50,10 @@ func (region *SRegion) GetInstanceOfferingByType(instanceType string) (*SInstanc
if err != nil {
return nil, err
}
if len(offerings) == 1 {
if len(offerings) >= 1 {
return &offerings[0], nil
}
if len(offerings) == 0 {
return nil, cloudprovider.ErrNotFound
}
return nil, fmt.Errorf("duplicate instanceType %s", instanceType)
return nil, cloudprovider.ErrNotFound
}
func (region *SRegion) CreateISku(sku *cloudprovider.SServerSku) (cloudprovider.ICloudSku, error) {