Consolidate receiver name

This commit is contained in:
Davor Kapsa 2019-10-09 21:18:46 +02:00 committed by GitHub
parent 046f94c996
commit 3eb075b9fc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 5 deletions

View File

@ -67,19 +67,19 @@ func (jd *JDCloudCredentialConfig) ValidateKeyPair() error {
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"}
for _, item := range regionArray {
if item == config.RegionId {
if item == jd.RegionId {
return nil
}
}
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 {
if len(config.Az) == 0 {
func (jd *JDCloudCredentialConfig) validateAz() error {
if len(jd.Az) == 0 {
return fmt.Errorf("[PRE-FLIGHT] az info missing")
}
return nil