mirror of https://github.com/usual2970/certimate
feat: set default region when applying certificates by huaweicloud
parent
908d33f186
commit
18a7bf0d66
|
@ -24,7 +24,12 @@ func (t *huaweicloud) Apply() (*Certificate, error) {
|
|||
access := &domain.HuaweiCloudAccess{}
|
||||
json.Unmarshal([]byte(t.option.Access), access)
|
||||
|
||||
os.Setenv("HUAWEICLOUD_REGION", access.Region) // 华为云的 SDK 要求必须传一个区域,实际上 DNS-01 流程里用不到,但不传会报错
|
||||
region := access.Region
|
||||
if region == "" {
|
||||
region = "cn-north-1"
|
||||
}
|
||||
|
||||
os.Setenv("HUAWEICLOUD_REGION", region) // 华为云的 SDK 要求必须传一个区域,实际上 DNS-01 流程里用不到,但不传会报错
|
||||
os.Setenv("HUAWEICLOUD_ACCESS_KEY_ID", access.AccessKeyId)
|
||||
os.Setenv("HUAWEICLOUD_SECRET_ACCESS_KEY", access.SecretAccessKey)
|
||||
os.Setenv("HUAWEICLOUD_PROPAGATION_TIMEOUT", fmt.Sprintf("%d", t.option.Timeout))
|
||||
|
|
|
@ -122,7 +122,7 @@ func (d *HuaweiCloudCDNDeployer) createClient(region, accessKeyId, secretAccessK
|
|||
}
|
||||
|
||||
if region == "" {
|
||||
region = "cn-north-1" // CDN 服务默认区域:华北北京一
|
||||
region = "cn-north-1" // CDN 服务默认区域:华北一北京
|
||||
}
|
||||
|
||||
hcRegion, err := cdnRegion.SafeValueOf(region)
|
||||
|
|
Loading…
Reference in New Issue