Skip to content
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