mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
fix: improve provisioner key cli usability (#14834)
What this changes: - Unhides the `--key` flag on provisioner start - Deprecates and hides `provisionerd` command group in favor of `provisioner(s)` - Removes org id from `coder provisioner keys list`
This commit is contained in:
@@ -7,6 +7,7 @@ import (
|
||||
"io"
|
||||
"net/http"
|
||||
"net/http/cookiejar"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/google/uuid"
|
||||
@@ -274,12 +275,22 @@ func (c *Client) ServeProvisionerDaemon(ctx context.Context, req ServeProvisione
|
||||
return proto.NewDRPCProvisionerDaemonClient(drpc.MultiplexedConn(session)), nil
|
||||
}
|
||||
|
||||
type ProvisionerKeyTags map[string]string
|
||||
|
||||
func (p ProvisionerKeyTags) String() string {
|
||||
tags := []string{}
|
||||
for key, value := range p {
|
||||
tags = append(tags, fmt.Sprintf("%s=%s", key, value))
|
||||
}
|
||||
return strings.Join(tags, " ")
|
||||
}
|
||||
|
||||
type ProvisionerKey struct {
|
||||
ID uuid.UUID `json:"id" table:"-" format:"uuid"`
|
||||
CreatedAt time.Time `json:"created_at" table:"created at" format:"date-time"`
|
||||
OrganizationID uuid.UUID `json:"organization" table:"organization id" format:"uuid"`
|
||||
Name string `json:"name" table:"name,default_sort"`
|
||||
Tags map[string]string `json:"tags" table:"tags"`
|
||||
ID uuid.UUID `json:"id" table:"-" format:"uuid"`
|
||||
CreatedAt time.Time `json:"created_at" table:"created at" format:"date-time"`
|
||||
OrganizationID uuid.UUID `json:"organization" table:"-" format:"uuid"`
|
||||
Name string `json:"name" table:"name,default_sort"`
|
||||
Tags ProvisionerKeyTags `json:"tags" table:"tags"`
|
||||
// HashedSecret - never include the access token in the API response
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user