Merge pull request #5254 from swordqiu/automated-cherry-pick-of-#5252-upstream-release-3.1

Automated cherry pick of #5252: fix: use globalEndpointType as default endpoint type
This commit is contained in:
Zexi Li
2020-02-26 10:37:37 +08:00
committed by GitHub
3 changed files with 8 additions and 2 deletions
+1 -1
View File
@@ -23,7 +23,7 @@ import (
)
func setInfluxdbRetentionPolicy() error {
urls, err := auth.GetServiceURLs("influxdb", options.Options.Region, "", "internal")
urls, err := auth.GetServiceURLs("influxdb", options.Options.Region, "", "")
if err != nil {
return err
}
+1 -1
View File
@@ -174,7 +174,7 @@ func (l *SLocalImageCache) prepare(ctx context.Context, zone, srcUrl, format str
l.consumerCount++
return true, true
}
url, err := auth.GetServiceURL("image", "", zone, "public")
url, err := auth.GetServiceURL("image", "", zone, "")
if err != nil {
log.Errorf("Failed to acquire image %s", err)
return false, true
+6
View File
@@ -210,10 +210,16 @@ func (a *authManager) reAuth() {
}
func (a *authManager) GetServiceURL(service, region, zone, endpointType string) (string, error) {
if endpointType == "" && globalEndpointType != "" {
endpointType = globalEndpointType
}
return a.adminCredential.GetServiceURL(service, region, zone, endpointType)
}
func (a *authManager) GetServiceURLs(service, region, zone, endpointType string) ([]string, error) {
if endpointType == "" && globalEndpointType != "" {
endpointType = globalEndpointType
}
return a.adminCredential.GetServiceURLs(service, region, zone, endpointType)
}