Skip to content

Commit

Permalink
default generated name to 10 chars (#1210)
Browse files Browse the repository at this point in the history
* default generated name to 10 chars

* CHANGELOG
  • Loading branch information
ssyno authored Nov 30, 2023
1 parent ce42b3e commit 58ce55b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ and this project's packages adheres to [Semantic Versioning](http://semver.org/s

## [Unreleased]

### Changed
- Changed the length of random generated cluster names to `10`

## [2.48.0] - 2023-11-29

### Added
Expand Down
5 changes: 3 additions & 2 deletions internal/key/key.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ const (
// (does not contain 1 and l, to avoid confusion)
NameChars = "023456789abcdefghijkmnopqrstuvwxyz"
// NameLengthLong represents the number of characters used to create a resource name when --enable-long-names feature flag is used.
NameLengthLong = 20
NameLengthLong = 20
NameLengthDefault = 10
// NameLengthShort represents the number of characters used to create a resource name.
NameLengthShort = 5

Expand Down Expand Up @@ -70,7 +71,7 @@ func GenerateName(enableLongNames bool) (string, error) {
letterRunes := []rune(NameChars)
length := NameLengthShort
if enableLongNames {
length = NameLengthLong
length = NameLengthDefault
}
characters := make([]rune, length)
r := rand.New(rand.NewSource(time.Now().UnixNano())) // #nosec G404
Expand Down

0 comments on commit 58ce55b

Please sign in to comment.