Skip to content

Commit

Permalink
Allow - and _ in org names (#324)
Browse files Browse the repository at this point in the history
Updates the shared client test cases.
  • Loading branch information
fmoor authored Nov 7, 2024
1 parent 8fc4b6e commit 0b17d5c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions internal/client/connutils.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ var (
`^(\w(?:-?\w)*)$`,
)
cloudInstanceNameRe = regexp.MustCompile(
`^([A-Za-z0-9](?:-?[A-Za-z0-9])*)/([A-Za-z0-9](?:-?[A-Za-z0-9])*)$`,
`^([A-Za-z0-9_\-](?:-?[A-Za-z_0-9\-])*)/([A-Za-z0-9](?:-?[A-Za-z0-9])*)$`,
)
domainLabelMaxLength = 63
crcTable *crc16.Table = crc16.MakeTable(crc16.CRC16_XMODEM)
Expand Down Expand Up @@ -151,7 +151,7 @@ func (r *configResolver) setInstance(val, source string) error {
match := instanceNameRe.FindStringSubmatch(val)
if len(match) == 0 {
match = cloudInstanceNameRe.FindStringSubmatch(val)
if len(match) == 0 {
if len(match) == 0 || strings.Contains(match[1], "--") {
return fmt.Errorf("invalid instance name %q", val)
}
r.org = cfgVal{val: match[1], source: source}
Expand Down
2 changes: 1 addition & 1 deletion shared-client-testcases

0 comments on commit 0b17d5c

Please sign in to comment.