Skip to content

Commit 9b3e7d2

Browse files
committed
Google Drive SDK does not bail on bad configuration
1 parent e731e54 commit 9b3e7d2

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

internal/storage/googledrive/googledrive.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,14 @@ import (
1212
"time"
1313

1414
"crypto/tls"
15+
"net/http"
16+
1517
"github.com/offen/docker-volume-backup/internal/errwrap"
1618
"github.com/offen/docker-volume-backup/internal/storage"
1719
"golang.org/x/oauth2"
1820
"golang.org/x/oauth2/google"
1921
"google.golang.org/api/drive/v3"
2022
"google.golang.org/api/option"
21-
"net/http"
2223
)
2324

2425
type googleDriveStorage struct {
@@ -47,6 +48,8 @@ func NewStorageBackend(opts Config, logFunc storage.Log) (storage.Backend, error
4748
}
4849
if opts.ImpersonateSubject != "" {
4950
config.Subject = opts.ImpersonateSubject
51+
} else {
52+
return nil, errwrap.Wrap(nil, "GOOGLE_DRIVE_IMPERSONATE_SUBJECT cannot be left blank")
5053
}
5154
if opts.TokenURL != "" {
5255
config.TokenURL = opts.TokenURL

0 commit comments

Comments
 (0)