Skip to content

Commit

Permalink
Enable underscores in azure resource groups
Browse files Browse the repository at this point in the history
  • Loading branch information
michaeljguarino committed May 11, 2022
1 parent 3469c8a commit 52733e2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/provider/azure.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ var azureSurvey = []*survey.Question{
{
Name: "resource",
Prompt: &survey.Input{Message: "Enter the name of the resource group to use as default: "},
Validate: utils.ValidateAlphaNumeric,
Validate: utils.ValidateAlphaNumExtended,
},
}

Expand Down
5 changes: 5 additions & 0 deletions pkg/utils/validation.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,11 @@ var ValidateAlphaNumeric = survey.ComposeValidators(
RegexValidator("[a-z][0-9\\-a-z]+", "Must be an alphanumeric string"),
)

var ValidateAlphaNumExtended = survey.ComposeValidators(
survey.Required,
RegexValidator("[a-zA-Z][0-9\\-_a-zA-Z]+", "Must be an alphanumeric string"),
)

func ValidateDns(val string) error {
return ValidateRegex(val, dnsRegex, "String must be a dns compliant hostname")
}

1 comment on commit 52733e2

@troyyyang
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😍

Please sign in to comment.