From 85affd4f4ecacd880d6d00fc32c3ad38e421f650 Mon Sep 17 00:00:00 2001 From: Spike Curtis Date: Wed, 10 Sep 2025 06:11:34 +0000 Subject: [PATCH] chore: cleanup unused Client in server command --- cli/server.go | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/cli/server.go b/cli/server.go index 5018007e2b4e8..9104417c7f83a 100644 --- a/cli/server.go +++ b/cli/server.go @@ -969,23 +969,10 @@ func (r *RootCmd) Server(newAPI func(context.Context, *coderd.Options) (*coderd. } } - client := codersdk.New(localURL) - if localURL.Scheme == "https" && IsLocalhost(localURL.Hostname()) { - // The certificate will likely be self-signed or for a different - // hostname, so we need to skip verification. - client.HTTPClient.Transport = &http.Transport{ - TLSClientConfig: &tls.Config{ - //nolint:gosec - InsecureSkipVerify: true, - }, - } - } - defer client.HTTPClient.CloseIdleConnections() - // This is helpful for tests, but can be silently ignored. // Coder may be ran as users that don't have permission to write in the homedir, // such as via the systemd service. - err = config.URL().Write(client.URL.String()) + err = config.URL().Write(localURL.String()) if err != nil && flag.Lookup("test.v") != nil { return xerrors.Errorf("write config url: %w", err) }