Merge pull request #5786 from ioito/automated-cherry-pick-of-#5785-upstream-release-3.1

Automated cherry pick of #5785: fix: 避免aliyun access key不可用时返回NotFoundError错误
This commit is contained in:
Zexi Li
2020-04-14 10:44:58 +08:00
committed by GitHub
+7
View File
@@ -119,6 +119,13 @@ func jsonRequest(client *sdk.Client, domain, apiVersion, apiName string, params
resp, err := _jsonRequest(client, domain, apiVersion, apiName, params)
retry := false
if err != nil {
for _, code := range []string{
"InvalidAccessKeyId.NotFound",
} {
if strings.Contains(err.Error(), code) {
return nil, err
}
}
for _, code := range []string{"404 Not Found"} {
if strings.Contains(err.Error(), code) {
return nil, cloudprovider.ErrNotFound