mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-09-24 16:03:43 +08:00
host session use internal endpoint
This commit is contained in:
@@ -53,15 +53,15 @@ type IHost interface {
|
||||
}
|
||||
|
||||
func GetComputeSession(ctx context.Context) *mcclient.ClientSession {
|
||||
return auth.GetAdminSessionWithPublic(ctx, options.HostOptions.Region, "v2")
|
||||
return auth.GetAdminSessionWithInternal(ctx, options.HostOptions.Region, "v2")
|
||||
}
|
||||
|
||||
func GetK8sSession(ctx context.Context) *mcclient.ClientSession {
|
||||
return auth.GetAdminSessionWithPublic(ctx, options.HostOptions.Region, "")
|
||||
return auth.GetAdminSessionWithInternal(ctx, options.HostOptions.Region, "")
|
||||
}
|
||||
|
||||
func GetImageSession(ctx context.Context, zone string) *mcclient.ClientSession {
|
||||
return auth.AdminSessionWithPublic(ctx, options.HostOptions.Region, zone, "v1")
|
||||
return auth.AdminSessionWithInternal(ctx, options.HostOptions.Region, zone, "v1")
|
||||
}
|
||||
|
||||
func TaskFailed(ctx context.Context, reason string) {
|
||||
|
||||
@@ -356,6 +356,11 @@ func GetAdminSessionWithPublic(ctx context.Context, region string,
|
||||
return GetSessionWithPublic(ctx, manager.adminCredential, region, apiVersion)
|
||||
}
|
||||
|
||||
func GetAdminSessionWithInternal(
|
||||
ctx context.Context, region string, apiVersion string) *mcclient.ClientSession {
|
||||
return GetSessionWithInternal(ctx, manager.adminCredential, region, apiVersion)
|
||||
}
|
||||
|
||||
func GetSession(ctx context.Context, token mcclient.TokenCredential, region string, apiVersion string) *mcclient.ClientSession {
|
||||
if len(globalEndpointType) != 0 {
|
||||
return getSessionByType(ctx, token, region, apiVersion, globalEndpointType)
|
||||
|
||||
Reference in New Issue
Block a user