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:
Cian Johnston
2023-12-07 16:59:13 +00:00
committed by GitHub
parent 8aea6040c8
commit 1e349f0d50
16 changed files with 170 additions and 22 deletions
+3
View File
@@ -177,6 +177,8 @@ func (c *Client) provisionerJobLogsAfter(ctx context.Context, path string, after
type ServeProvisionerDaemonRequest struct {
// ID is a unique ID for a provisioner daemon.
ID uuid.UUID `json:"id" format:"uuid"`
// Name is the human-readable unique identifier for the daemon.
Name string `json:"name" example:"my-cool-provisioner-daemon"`
// Organization is the organization for the URL. At present provisioner daemons ARE NOT scoped to organizations
// and so the organization ID is optional.
Organization uuid.UUID `json:"organization" format:"uuid"`
@@ -198,6 +200,7 @@ func (c *Client) ServeProvisionerDaemon(ctx context.Context, req ServeProvisione
}
query := serverURL.Query()
query.Add("id", req.ID.String())
query.Add("name", req.Name)
for _, provisioner := range req.Provisioners {
query.Add("provisioner", string(provisioner))
}