chore: upgrade tailscale to v1.46.1 (#8913)

This commit is contained in:
Colin Adler
2023-08-09 14:50:26 -05:00
committed by GitHub
parent 5b9dc2ee8b
commit bc862fa493
25 changed files with 467 additions and 297 deletions

View File

@ -14,6 +14,8 @@ import (
"golang.org/x/exp/slices"
"golang.org/x/xerrors"
"gopkg.in/yaml.v3"
"github.com/coder/coder/coderd/util/slice"
)
// Cmd describes an executable command.
@ -102,11 +104,11 @@ func (c *Cmd) PrepareAll() error {
}
}
slices.SortFunc(c.Options, func(a, b Option) bool {
return a.Name < b.Name
slices.SortFunc(c.Options, func(a, b Option) int {
return slice.Ascending(a.Name, b.Name)
})
slices.SortFunc(c.Children, func(a, b *Cmd) bool {
return a.Name() < b.Name()
slices.SortFunc(c.Children, func(a, b *Cmd) int {
return slice.Ascending(a.Name(), b.Name())
})
for _, child := range c.Children {
child.Parent = c

View File

@ -24,6 +24,7 @@ import (
"github.com/coder/coder/cli/clibase"
"github.com/coder/coder/cli/cliui"
"github.com/coder/coder/coderd/util/slice"
"github.com/coder/coder/codersdk"
)
@ -367,8 +368,8 @@ func (r *RootCmd) configSSH() *clibase.Cmd {
}
// Ensure stable sorting of output.
slices.SortFunc(workspaceConfigs, func(a, b sshWorkspaceConfig) bool {
return a.Name < b.Name
slices.SortFunc(workspaceConfigs, func(a, b sshWorkspaceConfig) int {
return slice.Ascending(a.Name, b.Name)
})
for _, wc := range workspaceConfigs {
sort.Strings(wc.Hosts)

View File

@ -13,6 +13,7 @@ import (
"github.com/coder/coder/cli/clibase"
"github.com/coder/coder/cli/cliui"
"github.com/coder/coder/coderd/util/ptr"
"github.com/coder/coder/coderd/util/slice"
"github.com/coder/coder/codersdk"
)
@ -81,8 +82,8 @@ func (r *RootCmd) create() *clibase.Cmd {
return err
}
slices.SortFunc(templates, func(a, b codersdk.Template) bool {
return a.ActiveUserCount > b.ActiveUserCount
slices.SortFunc(templates, func(a, b codersdk.Template) int {
return slice.Descending(a.ActiveUserCount, b.ActiveUserCount)
})
templateNames := make([]string, 0, len(templates))