Skip to content

Commit a594056

Browse files
authored
Merge pull request #2099 from felixfontein/gcp
Revert "Merge pull request #1697 from onjen/fix-1142"
2 parents c48a98a + c8f175b commit a594056

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

gcpkms/keysource.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -280,14 +280,13 @@ func (key *MasterKey) TypeToIdentifier() string {
280280
// It returns an error if the ResourceID is invalid, or if the setup of the
281281
// client fails.
282282
func (key *MasterKey) newKMSClient(ctx context.Context) (*kms.KeyManagementClient, error) {
283-
re := regexp.MustCompile(`^projects/(?P<project>[^/]+)/locations/[^/]+/keyRings/[^/]+/cryptoKeys/[^/]+$`)
283+
re := regexp.MustCompile(`^projects/[^/]+/locations/[^/]+/keyRings/[^/]+/cryptoKeys/[^/]+$`)
284284
matches := re.FindStringSubmatch(key.ResourceID)
285285
if matches == nil {
286286
return nil, fmt.Errorf("no valid resource ID found in %q", key.ResourceID)
287287
}
288288

289289
var opts []option.ClientOption
290-
opts = append(opts, option.WithQuotaProject(matches[1]))
291290
switch {
292291
case key.tokenSource != nil:
293292
opts = append(opts, option.WithTokenSource(key.tokenSource))

0 commit comments

Comments
 (0)