diff --git a/internal/client/connutils.go b/internal/client/connutils.go index c3f901e..328d307 100644 --- a/internal/client/connutils.go +++ b/internal/client/connutils.go @@ -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) @@ -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} diff --git a/shared-client-testcases b/shared-client-testcases index 94099c2..071f604 160000 --- a/shared-client-testcases +++ b/shared-client-testcases @@ -1 +1 @@ -Subproject commit 94099c29e0811b0fb1f662b5089fbeaaaa3d4e9f +Subproject commit 071f60430207e331b847e1dcc10cba19c5b5f2f4