Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit dcfdce8

Browse files
committed
fix: sort provisioner key tags in cli output
1 parent 5246f8d commit dcfdce8

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

codersdk/provisionerdaemons.go

+6-2
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ import (
1212

1313
"github.com/google/uuid"
1414
"github.com/hashicorp/yamux"
15+
"golang.org/x/exp/maps"
16+
"golang.org/x/exp/slices"
1517
"golang.org/x/xerrors"
1618
"nhooyr.io/websocket"
1719

@@ -278,9 +280,11 @@ func (c *Client) ServeProvisionerDaemon(ctx context.Context, req ServeProvisione
278280
type ProvisionerKeyTags map[string]string
279281

280282
func (p ProvisionerKeyTags) String() string {
283+
keys := maps.Keys(p)
284+
slices.Sort(keys)
281285
tags := []string{}
282-
for key, value := range p {
283-
tags = append(tags, fmt.Sprintf("%s=%s", key, value))
286+
for _, key := range keys {
287+
tags = append(tags, fmt.Sprintf("%s=%s", key, p[key]))
284288
}
285289
return strings.Join(tags, " ")
286290
}

0 commit comments

Comments
 (0)