From babb7ae742e070b0d0e9faeb120cc3b8ebfafe41 Mon Sep 17 00:00:00 2001 From: Yousong Zhou Date: Wed, 15 Apr 2020 17:52:12 +0800 Subject: [PATCH 1/3] region: lbagents: default to using public type endpoint of influxdb --- pkg/compute/models/loadbalanceragents.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pkg/compute/models/loadbalanceragents.go b/pkg/compute/models/loadbalanceragents.go index 5ae83744c1..4b2563b574 100644 --- a/pkg/compute/models/loadbalanceragents.go +++ b/pkg/compute/models/loadbalanceragents.go @@ -31,6 +31,7 @@ import ( "yunion.io/x/onecloud/pkg/apis" api "yunion.io/x/onecloud/pkg/apis/compute" + identity_apis "yunion.io/x/onecloud/pkg/apis/identity" "yunion.io/x/onecloud/pkg/cloudcommon/db" "yunion.io/x/onecloud/pkg/cloudcommon/validators" "yunion.io/x/onecloud/pkg/compute/options" @@ -250,7 +251,8 @@ func (p *SLoadbalancerAgentParamsTelegraf) Validate(data *jsonutils.JSONDict) er func (p *SLoadbalancerAgentParamsTelegraf) initDefault(data *jsonutils.JSONDict) { if p.InfluxDbOutputUrl == "" { baseOpts := &options.Options - u, _ := auth.GetServiceURL("influxdb", baseOpts.Region, "", "") + u, _ := auth.GetServiceURL("influxdb", baseOpts.Region, "", + identity_apis.EndpointInterfacePublic) p.InfluxDbOutputUrl = u } if p.HaproxyInputInterval == 0 { From 59b143f9059719f46f51b39856ca196baec468d8 Mon Sep 17 00:00:00 2001 From: Yousong Zhou Date: Wed, 15 Apr 2020 17:57:18 +0800 Subject: [PATCH 2/3] image: use identity_apis.EndpointInterfacePublic --- pkg/image/torrent/torrent.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkg/image/torrent/torrent.go b/pkg/image/torrent/torrent.go index e8f25e7d7a..dec787d125 100644 --- a/pkg/image/torrent/torrent.go +++ b/pkg/image/torrent/torrent.go @@ -21,6 +21,7 @@ import ( "yunion.io/x/log" + identity_apis "yunion.io/x/onecloud/pkg/apis/identity" "yunion.io/x/onecloud/pkg/appsrv" "yunion.io/x/onecloud/pkg/image/options" "yunion.io/x/onecloud/pkg/mcclient/auth" @@ -80,7 +81,7 @@ func SeedTorrent(torrentpath string, imageId, format string) error { } func seedTorrent(torrentpath string, imageId, format string) error { - url, err := auth.GetServiceURL("image", options.Options.Region, "", "public") + url, err := auth.GetServiceURL("image", options.Options.Region, "", identity_apis.EndpointInterfacePublic) if err != nil { return err } From 6b0a97c6fb941a641e1b927de89277e1cee06611 Mon Sep 17 00:00:00 2001 From: Yousong Zhou Date: Wed, 15 Apr 2020 17:58:09 +0800 Subject: [PATCH 3/3] region: buckets: use identity_apis.EndpointInterfacePublic --- pkg/compute/models/buckets.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pkg/compute/models/buckets.go b/pkg/compute/models/buckets.go index 50190391f2..943b307a08 100644 --- a/pkg/compute/models/buckets.go +++ b/pkg/compute/models/buckets.go @@ -31,6 +31,7 @@ import ( "yunion.io/x/sqlchemy" api "yunion.io/x/onecloud/pkg/apis/compute" + identity_apis "yunion.io/x/onecloud/pkg/apis/identity" "yunion.io/x/onecloud/pkg/appsrv" "yunion.io/x/onecloud/pkg/cloudcommon/db" "yunion.io/x/onecloud/pkg/cloudcommon/db/lockman" @@ -548,7 +549,8 @@ func joinPath(ep, path string) string { } func (bucket *SBucket) getMoreDetails(out api.BucketDetails) api.BucketDetails { - s3gwUrl, _ := auth.GetServiceURL("s3gateway", options.Options.Region, "", "public") + s3gwUrl, _ := auth.GetServiceURL("s3gateway", options.Options.Region, "", identity_apis.EndpointInterfacePublic) + if len(s3gwUrl) > 0 { accessUrls := make([]cloudprovider.SBucketAccessUrl, 0) if bucket.AccessUrls != nil {