Skip to content

feat(coderd): store workspace proxy version in the database #10790

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Nov 21, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
feat(coderd): store workspace proxy version in database upon register
  • Loading branch information
johnstcn committed Nov 21, 2023
commit c9edab33435396c70aad55abea949814698a671a
2 changes: 1 addition & 1 deletion cli/server_internal_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ func TestIsDERPPath(t *testing.T) {
//{
// path: "/derp",
// expected: true,
//},
// },
{
path: "/derp/",
expected: true,
Expand Down
1 change: 1 addition & 0 deletions coderd/database/dbmem/dbmem.go
Original file line number Diff line number Diff line change
Expand Up @@ -5563,6 +5563,7 @@ func (q *FakeQuerier) RegisterWorkspaceProxy(_ context.Context, arg database.Reg
p.WildcardHostname = arg.WildcardHostname
p.DerpEnabled = arg.DerpEnabled
p.DerpOnly = arg.DerpOnly
p.Version = arg.Version
p.UpdatedAt = dbtime.Now()
q.workspaceProxies[i] = p
return p, nil
Expand Down
5 changes: 4 additions & 1 deletion coderd/database/queries.sql.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions coderd/database/queries/proxies.sql
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ SET
wildcard_hostname = @wildcard_hostname :: text,
derp_enabled = @derp_enabled :: boolean,
derp_only = @derp_only :: boolean,
version = @version :: text,
updated_at = Now()
WHERE
id = @id
Expand Down
1 change: 1 addition & 0 deletions enterprise/coderd/proxyhealth/proxyhealth_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ func insertProxy(t *testing.T, db database.Store, url string) database.Workspace
Url: url,
WildcardHostname: "",
ID: proxy.ID,
Version: `v2.34.5-test+beefcake`,
})
require.NoError(t, err, "failed to update proxy")
return proxy
Expand Down
1 change: 1 addition & 0 deletions enterprise/coderd/workspaceproxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -625,6 +625,7 @@ func (api *API) workspaceProxyRegister(rw http.ResponseWriter, r *http.Request)
DerpEnabled: req.DerpEnabled,
DerpOnly: req.DerpOnly,
WildcardHostname: req.WildcardHostname,
Version: req.Version,
})
if err != nil {
return xerrors.Errorf("register workspace proxy: %w", err)
Expand Down