mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
chore: refactor cli and coderd to use ClientOptions (#19763)
Refactors CLI and coderd to use the ClientBuilder pattern rather than directly instantiating the Client.
This commit is contained in:
@@ -1004,9 +1004,10 @@ func (r *RootCmd) scaletestWorkspaceTraffic() *serpent.Command {
|
||||
return xerrors.Errorf("parse workspace proxy URL: %w", err)
|
||||
}
|
||||
|
||||
webClient = codersdk.New(u)
|
||||
webClient.HTTPClient = client.HTTPClient
|
||||
webClient.SetSessionToken(client.SessionToken())
|
||||
webClient = codersdk.New(u,
|
||||
codersdk.WithHTTPClient(client.HTTPClient),
|
||||
codersdk.WithSessionToken(client.SessionToken()),
|
||||
)
|
||||
|
||||
appConfig, err = createWorkspaceAppConfig(webClient, appHost.Host, app, ws, agent)
|
||||
if err != nil {
|
||||
@@ -1240,8 +1241,9 @@ func (r *RootCmd) scaletestDashboard() *serpent.Command {
|
||||
return xerrors.Errorf("create token for user: %w", err)
|
||||
}
|
||||
|
||||
userClient := codersdk.New(client.URL)
|
||||
userClient.SetSessionToken(userTokResp.Key)
|
||||
userClient := codersdk.New(client.URL,
|
||||
codersdk.WithSessionToken(userTokResp.Key),
|
||||
)
|
||||
|
||||
config := dashboard.Config{
|
||||
Interval: interval,
|
||||
|
||||
Reference in New Issue
Block a user