Skip to content

Commit 790cfc3

Browse files
committed
update golden files
1 parent 460f8cf commit 790cfc3

File tree

4 files changed

+2
-37
lines changed

4 files changed

+2
-37
lines changed

cli/root.go

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -835,21 +835,10 @@ func (r *RootCmd) checkVersions(i *clibase.Invocation, client *codersdk.Client,
835835
return xerrors.Errorf("build info: %w", err)
836836
}
837837

838-
dconfig, err := client.UnprivilegedDeploymentConfig(ctx)
839-
if err != nil {
840-
return xerrors.Errorf("deployment config: %w", err)
841-
}
842-
843838
fmtWarningText := "version mismatch: client %s, server %s\n%s"
844839

845-
warn := cliui.DefaultStyles.Warn
846-
warning := fmt.Sprintf(pretty.Sprint(warn, fmtWarningText), clientVersion, info.Version, strings.TrimPrefix(info.CanonicalVersion(), "v"), info.UpgradeMessage)
847-
848-
// If a custom upgrade message has been set, override the default that we
849-
// display.
850-
if msg := dconfig.CLIUpgradeMessage; msg != "" {
851-
warning = fmt.Sprint(pretty.Sprint(warn, msg))
852-
}
840+
fmtWarn := pretty.Sprint(cliui.DefaultStyles.Warn, fmtWarningText)
841+
warning := fmt.Sprintf(fmtWarn, info.Version, strings.TrimPrefix(info.CanonicalVersion(), "v"), info.UpgradeMessage)
853842

854843
if !buildinfo.VersionsMatch(clientVersion, info.Version) || forceCheck {
855844
_, _ = fmt.Fprint(i.Stderr, warning)

cli/testdata/coder_list_--output_json.golden

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
check versions error: deployment config: GET http://localhost:36329/api/v2/deployment/unprivileged: unexpected status code 404: Route not found.
21
[
32
{
43
"id": "[workspace ID]",

cli/testdata/coder_users_list_--output_json.golden

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
check versions error: deployment config: GET http://localhost:36329/api/v2/deployment/unprivileged: unexpected status code 404: Route not found.
21
[
32
{
43
"id": "[first user ID]",

codersdk/deployment.go

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -2104,28 +2104,6 @@ func (c *Client) BuildInfo(ctx context.Context) (BuildInfoResponse, error) {
21042104
return buildInfo, json.NewDecoder(res.Body).Decode(&buildInfo)
21052105
}
21062106

2107-
type UnprivilegedDeploymentConfig struct {
2108-
SSHConfig SSHConfigResponse `json:"ssh_config"`
2109-
CLIUpgradeMessage string `json:"cli_upgrade_message"`
2110-
}
2111-
2112-
// UnprivilegedDeploymentConfig returns unsensitive config values
2113-
// accessible by an ordinary, unprivileged user.
2114-
func (c *Client) UnprivilegedDeploymentConfig(ctx context.Context) (UnprivilegedDeploymentConfig, error) {
2115-
res, err := c.Request(ctx, http.MethodGet, "/api/v2/deployment/unprivileged", nil)
2116-
if err != nil {
2117-
return UnprivilegedDeploymentConfig{}, err
2118-
}
2119-
defer res.Body.Close()
2120-
2121-
if res.StatusCode != http.StatusOK {
2122-
return UnprivilegedDeploymentConfig{}, ReadBodyAsError(res)
2123-
}
2124-
2125-
var config UnprivilegedDeploymentConfig
2126-
return config, json.NewDecoder(res.Body).Decode(&config)
2127-
}
2128-
21292107
type Experiment string
21302108

21312109
const (

0 commit comments

Comments
 (0)