Skip to content
This repository has been archived by the owner on Nov 1, 2024. It is now read-only.

Commit

Permalink
bug(bq): only delete user managed keys
Browse files Browse the repository at this point in the history
  • Loading branch information
paulbes committed Aug 9, 2024
1 parent e1ff903 commit 8b72dba
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions pkg/service/core/api/gcp/gcp_service_account.go
Original file line number Diff line number Diff line change
Expand Up @@ -160,9 +160,11 @@ func (a *serviceAccountAPI) recreateServiceAccountKey(ctx context.Context, accou
}

for _, key := range keys.Keys {
_, err := iamService.Projects.ServiceAccounts.Keys.Delete(key.Name).Do()
if err != nil {
return nil, errs.E(errs.IO, op, err)
if key.KeyType == "USER_MANAGED" {
_, err := iamService.Projects.ServiceAccounts.Keys.Delete(key.Name).Do()
if err != nil {
return nil, errs.E(errs.IO, op, err)
}
}
}

Expand Down

0 comments on commit 8b72dba

Please sign in to comment.