chore: fix api param name (#20172)

In https://github.com/coder/coder/pull/20137, we added a new flag to
`coder provisioner jobs list`, namely `--initiator`.

To make some follow-up worth it, I need to rename an API param used in
the process before it becomes part of our released and tagged API.

Instead of only accepting UUIDs, we accept an arbitrary string.
We still validate it as a UUID now, but we will expand its validation to
allow any string and then resolve that string the same way that we
resolve the user parameter elsewhere in the API.
This commit is contained in:
Sas Swart
2025-10-06 13:58:37 +02:00
committed by GitHub
parent dd99d40ad6
commit a7c9e623fe
5 changed files with 23 additions and 25 deletions
+7 -7
View File
@@ -397,11 +397,11 @@ func (c *Client) OrganizationProvisionerDaemons(ctx context.Context, organizatio
}
type OrganizationProvisionerJobsOptions struct {
Limit int
IDs []uuid.UUID
Status []ProvisionerJobStatus
Tags map[string]string
InitiatorID *uuid.UUID
Limit int
IDs []uuid.UUID
Status []ProvisionerJobStatus
Tags map[string]string
Initiator string
}
func (c *Client) OrganizationProvisionerJobs(ctx context.Context, organizationID uuid.UUID, opts *OrganizationProvisionerJobsOptions) ([]ProvisionerJob, error) {
@@ -423,8 +423,8 @@ func (c *Client) OrganizationProvisionerJobs(ctx context.Context, organizationID
}
qp.Add("tags", string(tagsRaw))
}
if opts.InitiatorID != nil {
qp.Add("initiator_id", opts.InitiatorID.String())
if opts.Initiator != "" {
qp.Add("initiator", opts.Initiator)
}
}