mirror of
https://github.com/restic/restic.git
synced 2025-08-21 12:27:32 +00:00
Merge pull request #3107 from eleith/do-not-require-bucket-permissions-for-init
do not require gs bucket permissions to init repository
This commit is contained in:
@@ -136,6 +136,11 @@ func Create(cfg Config, rt http.RoundTripper) (restic.Backend, error) {
|
||||
ctx := context.Background()
|
||||
exists, err := be.bucketExists(ctx, be.bucket)
|
||||
if err != nil {
|
||||
if e, ok := err.(*googleapi.Error); ok && e.Code == http.StatusForbidden {
|
||||
// the bucket might exist!
|
||||
// however, the client doesn't have storage.bucket.get permission
|
||||
return be, nil
|
||||
}
|
||||
return nil, errors.Wrap(err, "service.Buckets.Get")
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user