commit
9aac2246f2
|
@ -67,19 +67,19 @@ func (jd *JDCloudCredentialConfig) ValidateKeyPair() error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (config *JDCloudCredentialConfig) validateRegion() error {
|
func (jd *JDCloudCredentialConfig) validateRegion() error {
|
||||||
regionArray := []string{"cn-north-1", "cn-south-1", "cn-east-1", "cn-east-2"}
|
regionArray := []string{"cn-north-1", "cn-south-1", "cn-east-1", "cn-east-2"}
|
||||||
for _, item := range regionArray {
|
for _, item := range regionArray {
|
||||||
if item == config.RegionId {
|
if item == jd.RegionId {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return fmt.Errorf("[PRE-FLIGHT] Invalid RegionId:%s. "+
|
return fmt.Errorf("[PRE-FLIGHT] Invalid RegionId:%s. "+
|
||||||
"Legit RegionId are: {cn-north-1, cn-south-1, cn-east-1, cn-east-2}", config.RegionId)
|
"Legit RegionId are: {cn-north-1, cn-south-1, cn-east-1, cn-east-2}", jd.RegionId)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (config *JDCloudCredentialConfig) validateAz() error {
|
func (jd *JDCloudCredentialConfig) validateAz() error {
|
||||||
if len(config.Az) == 0 {
|
if len(jd.Az) == 0 {
|
||||||
return fmt.Errorf("[PRE-FLIGHT] az info missing")
|
return fmt.Errorf("[PRE-FLIGHT] az info missing")
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
|
|
Loading…
Reference in New Issue