Skip to content

Commit

Permalink
Fix issue with postfixId for rolename generation
Browse files Browse the repository at this point in the history
  • Loading branch information
rmennes committed Sep 17, 2024
1 parent 297e75a commit 045058a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ func (g *uniqueNameGenerator) Generate(ap *sync_to_target.AccessProvider) (strin
}

if currentNumber, found := g.existingNames[name]; found {
postfixId := fmt.Sprintf("%[1]c%[1]c%[2]x", g.splitCharacter, currentNumber)
postfixId := fmt.Sprintf("%[1]c%[1]c%[2]X", g.splitCharacter, currentNumber)

if !g.constraints.UpperCaseLetters {
postfixId = strings.ToLower(postfixId)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ func TestUniqueGenerator_Generate_DuplicatedNames(t *testing.T) {

func TestUniqueGenerator_Generate_DuplicatedNames_uppercase(t *testing.T) {
//Given
upperCaseRegex := regexp.MustCompile("[A-Z0-9_]+")
upperCaseRegex := regexp.MustCompile("^[A-Z0-9_]+$")

constraints := NamingConstraints{
UpperCaseLetters: true,
Expand Down

0 comments on commit 045058a

Please sign in to comment.