fix: remove apiversion param from session

This commit is contained in:
QIU Jian
2022-08-25 09:43:50 +08:00
committed by Qiu Jian
parent c6f557fd68
commit 293afd2e69
165 changed files with 381 additions and 487 deletions
+1 -1
View File
@@ -69,7 +69,7 @@ func getCommand(ctx context.Context, us *mcclient.ClientSession, ip string, port
if !o.Options.EnableAutoLogin {
return "", nil, nil
}
s := auth.GetAdminSession(ctx, o.Options.Region, "v2")
s := auth.GetAdminSession(ctx, o.Options.Region)
key, err := compute.Sshkeypairs.GetById(s, us.GetProjectId(), jsonutils.Marshal(map[string]bool{"admin": true}))
if err != nil {
return "", nil, err
+2 -2
View File
@@ -80,7 +80,7 @@ func fetchK8sEnv(ctx context.Context, w http.ResponseWriter, r *http.Request) (*
k8sReq.Namespace = "default"
}
podName := params["<podName>"]
adminSession := auth.GetAdminSession(ctx, o.Options.Region, "")
adminSession := auth.GetAdminSession(ctx, o.Options.Region)
query := jsonutils.NewDict()
query.Add(jsonutils.NewString(k8sReq.Namespace), "namespace")
@@ -134,7 +134,7 @@ func fetchCloudEnv(ctx context.Context, w http.ResponseWriter, r *http.Request)
if userCred == nil {
return nil, httperrors.NewUnauthorizedError("No token founded")
}
s := auth.Client().NewSession(ctx, o.Options.Region, "", "internal", userCred, "v2")
s := auth.Client().NewSession(ctx, o.Options.Region, "", "internal", userCred)
return &CloudEnv{
ClientSessin: s,
Params: params,