Skip to content

Commit

Permalink
Unbreak compute engine url signing #6921
Browse files Browse the repository at this point in the history
Signed-off-by: Tiger Kaovilai <[email protected]>
  • Loading branch information
kaovilai committed Oct 5, 2023
1 parent 343aa79 commit 1f164ca
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions velero-plugin-for-gcp/object_store.go
Original file line number Diff line number Diff line change
Expand Up @@ -301,8 +301,10 @@ func (o *ObjectStore) SignBytes(bytes []byte) ([]byte, error) {
}

func (o *ObjectStore) CreateSignedURL(bucket, key string, ttl time.Duration) (string, error) {
if o.fileCredType != serviceAccountKey {
return "", errors.New("cannot sign blob using non SA file credentials")
// googleAccessID is initialized from ServiceAccount key file and compute engine credentials.
// If using external_account credentials, googleAccessID will be empty and we cannot create signed URL.
if o.googleAccessID == "" {
return "", errors.New("GoogleAccessID is empty, perhaps using external_account credentials, cannot create signed URL")
}
options := storage.SignedURLOptions{
GoogleAccessID: o.googleAccessID,
Expand Down

0 comments on commit 1f164ca

Please sign in to comment.