fix: use globalEndpointType as default endpoint type

This commit is contained in:
Qiu Jian
2020-02-25 20:47:15 +08:00
parent 1b5756fe1c
commit b395dc8cee
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)
}