Make sure list of managers is deterministic

This commit is contained in:
Lennart Kats 2024-10-04 21:08:44 -07:00
parent c850cfbecd
commit 763bcd5aad
No known key found for this signature in database
GPG Key ID: 1EB8B57673197023
1 changed files with 4 additions and 1 deletions

View File

@ -3,6 +3,7 @@ package permissions
import ( import (
"context" "context"
"fmt" "fmt"
"sort"
"strings" "strings"
"github.com/databricks/cli/bundle" "github.com/databricks/cli/bundle"
@ -87,9 +88,11 @@ func analyzeBundlePermissions(b *bundle.Bundle) (bool, string) {
assistance := "For assistance, contact the owners of this project." assistance := "For assistance, contact the owners of this project."
if otherManagers.Size() > 0 { if otherManagers.Size() > 0 {
list := otherManagers.Values()
sort.Strings(list)
assistance = fmt.Sprintf( assistance = fmt.Sprintf(
"For assistance, users or groups with appropriate permissions may include: %s.", "For assistance, users or groups with appropriate permissions may include: %s.",
strings.Join(otherManagers.Values(), ", "), strings.Join(list, ", "),
) )
} }
return canManageBundle, assistance return canManageBundle, assistance