mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
feat(cli): allow specifying name of provisioner daemon (#11077)
- Adds a --name argument to provisionerd start - Plumbs through name to integrated and external provisioners - Defaults to hostname if not specified for external, hostname-N for integrated - Adds cliutil.Hostname
This commit is contained in:
@@ -7,7 +7,6 @@ import (
|
||||
"fmt"
|
||||
"net/http"
|
||||
"net/url"
|
||||
"os"
|
||||
"reflect"
|
||||
"regexp"
|
||||
"strings"
|
||||
@@ -27,6 +26,7 @@ import (
|
||||
|
||||
"cdr.dev/slog"
|
||||
"github.com/coder/coder/v2/buildinfo"
|
||||
"github.com/coder/coder/v2/cli/cliutil"
|
||||
"github.com/coder/coder/v2/coderd"
|
||||
"github.com/coder/coder/v2/coderd/httpapi"
|
||||
"github.com/coder/coder/v2/coderd/httpmw"
|
||||
@@ -206,10 +206,7 @@ func New(ctx context.Context, opts *Options) (*Server, error) {
|
||||
// Register the workspace proxy with the primary coderd instance and start a
|
||||
// goroutine to periodically re-register.
|
||||
replicaID := uuid.New()
|
||||
osHostname, err := os.Hostname()
|
||||
if err != nil {
|
||||
return nil, xerrors.Errorf("get OS hostname: %w", err)
|
||||
}
|
||||
osHostname := cliutil.Hostname()
|
||||
regResp, registerDone, err := client.RegisterWorkspaceProxyLoop(ctx, wsproxysdk.RegisterWorkspaceProxyLoopOpts{
|
||||
Logger: opts.Logger,
|
||||
Request: wsproxysdk.RegisterWorkspaceProxyRequest{
|
||||
|
||||
Reference in New Issue
Block a user