Skip to content

chore: Allow editing proxy fields via api. #7435

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 16 commits into from
May 9, 2023
Merged
Prev Previous commit
Next Next commit
Add proxy edit cli cmd
  • Loading branch information
Emyrk committed May 5, 2023
commit ae5c41ee8cfcbd3ba08fd194bb06c6a006c151fa
4 changes: 4 additions & 0 deletions enterprise/cli/workspaceproxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ func (r *RootCmd) workspaceProxy() *clibase.Cmd {
r.createProxy(),
r.deleteProxy(),
r.listProxies(),
r.patchProxy(),
},
}

Expand Down Expand Up @@ -81,6 +82,9 @@ func (r *RootCmd) patchProxy() *clibase.Cmd {
DisplayName: displayName,
Icon: proxyIcon,
})
if err != nil {
return xerrors.Errorf("update workspace proxy %q: %w", inv.Args[0], err)
}

_, _ = formatter.Format(ctx, updated)
return nil
Expand Down
2 changes: 1 addition & 1 deletion enterprise/coderd/coderd.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ func New(ctx context.Context, options *Options) (*API, error) {
httpmw.ExtractWorkspaceProxyParam(api.Database),
)

r.Get("/", api.getWorkspaceProxy)
r.Get("/", api.workspaceProxy)
r.Patch("/", api.patchWorkspaceProxy)
r.Delete("/", api.deleteWorkspaceProxy)
})
Expand Down
2 changes: 1 addition & 1 deletion enterprise/coderd/workspaceproxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ func (api *API) deleteWorkspaceProxy(rw http.ResponseWriter, r *http.Request) {
// @Param workspaceproxy path string true "Proxy ID or name" format(uuid)
// @Success 200 {object} codersdk.WorkspaceProxy
// @Router /workspaceproxies/{workspaceproxy} [get]
func (api *API) getWorkspaceProxy(rw http.ResponseWriter, r *http.Request) {
func (api *API) workspaceProxy(rw http.ResponseWriter, r *http.Request) {
var (
ctx = r.Context()
proxy = httpmw.WorkspaceProxyParam(r)
Expand Down