Skip to content

Commit 0898415

Browse files
authored
Merge pull request #2117 from JordanP/patch-1
pkg/common/utils.go: update regionalLocationFmt for Europe with 10+ regions
2 parents 0061918 + b8ca4f6 commit 0898415

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

pkg/common/utils.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ const (
7171
// Example: us
7272
multiRegionalLocationFmt = "^[a-z]+$"
7373
// Example: us-east1
74-
regionalLocationFmt = "^[a-z]+-[a-z]+[0-9]$"
74+
regionalLocationFmt = "^[a-z]+-[a-z]+[0-9]{1,2}$"
7575

7676
// Full or partial URL of the machine type resource, in the format:
7777
// zones/zone/machineTypes/machine-type

pkg/common/utils_test.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -804,10 +804,16 @@ func TestSnapshotStorageLocations(t *testing.T) {
804804
[]string{"us-east1"},
805805
false,
806806
},
807+
{
808+
"valid region in large continent",
809+
"europe-west12",
810+
[]string{"europe-west12"},
811+
false,
812+
},
807813
{
808814
// Zones are not valid bucket/snapshot locations.
809815
"single zone",
810-
"us-east1a",
816+
"us-east1-a",
811817
[]string{},
812818
true,
813819
},

0 commit comments

Comments
 (0)