File tree 2 files changed +4
-3
lines changed
mmv1/third_party/terraform/tpgresource
2 files changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -172,7 +172,7 @@ func GetRegionFromRegionalSelfLink(selfLink string) string {
172
172
}
173
173
174
174
func GetProjectFromRegionalSelfLink (selfLink string ) string {
175
- re := regexp .MustCompile ("projects/([a-zA-Z0-9-]*)/(?:locations|regions)/[a-zA-Z0-9-]*" )
175
+ re := regexp .MustCompile ("projects/([a-zA-Z0-9-: ]*)/(?:locations|regions)/[a-zA-Z0-9-: ]*" )
176
176
switch {
177
177
case re .MatchString (selfLink ):
178
178
if res := re .FindStringSubmatch (selfLink ); len (res ) == 2 && res [1 ] != "" {
Original file line number Diff line number Diff line change @@ -125,8 +125,9 @@ func TestGetRegionFromRegionalSelfLink(t *testing.T) {
125
125
126
126
func TestGetProjectFromRegionalSelfLink (t * testing.T ) {
127
127
cases := map [string ]string {
128
- "projects/foo/locations/europe-north1/datasets/bar/operations/foobar" : "foo" ,
129
- "projects/REDACTED/regions/europe-north1/subnetworks/tf-test-net-xbwhsmlfm8" : "REDACTED" ,
128
+ "projects/foo/locations/europe-north1/datasets/bar/operations/foobar" : "foo" ,
129
+ "projects/REDACTED/regions/europe-north1/subnetworks/tf-test-net-xbwhsmlfm8" : "REDACTED" ,
130
+ "projects/REDA:CT-ED09/regions/europe-north1/subnetworks/tf-test-net-xbwhsmlfm8" : "REDA:CT-ED09" ,
130
131
}
131
132
for input , expected := range cases {
132
133
if result := GetProjectFromRegionalSelfLink (input ); result != expected {
You can’t perform that action at this time.
0 commit comments