Skip to content

Commit 85affd4

Browse files
committed
chore: cleanup unused Client in server command
1 parent e9af6ff commit 85affd4

File tree

1 file changed

+1
-14
lines changed

1 file changed

+1
-14
lines changed

cli/server.go

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -969,23 +969,10 @@ func (r *RootCmd) Server(newAPI func(context.Context, *coderd.Options) (*coderd.
969969
}
970970
}
971971

972-
client := codersdk.New(localURL)
973-
if localURL.Scheme == "https" && IsLocalhost(localURL.Hostname()) {
974-
// The certificate will likely be self-signed or for a different
975-
// hostname, so we need to skip verification.
976-
client.HTTPClient.Transport = &http.Transport{
977-
TLSClientConfig: &tls.Config{
978-
//nolint:gosec
979-
InsecureSkipVerify: true,
980-
},
981-
}
982-
}
983-
defer client.HTTPClient.CloseIdleConnections()
984-
985972
// This is helpful for tests, but can be silently ignored.
986973
// Coder may be ran as users that don't have permission to write in the homedir,
987974
// such as via the systemd service.
988-
err = config.URL().Write(client.URL.String())
975+
err = config.URL().Write(localURL.String())
989976
if err != nil && flag.Lookup("test.v") != nil {
990977
return xerrors.Errorf("write config url: %w", err)
991978
}

0 commit comments

Comments
 (0)