firebase-admin-go
firebase-admin-go copied to clipboard
storage: bucket.Objects always returns "bucket doesn't exist" when using Firebase Emulator
I have a function that deletes some objects. This function works well, but when is used with Firebase Emulator, always return "bucket doesn't exist".
go 1.16
Code e.g.
storage, err := fire.DefaultFirebaseApp.Storage(ctx)
if err != nil {
return err
}
bucket, err := storage.DefaultBucket()
if err != nil {
return err
}
it := bucket.Objects(ctx, &cloudStorage.Query{
Prefix: 'images/img',
})
for {
attrs, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
return err
}
err = bucket.Object(attrs.Name).Delete(ctx)
if err != nil {
return err
}
}
return nil
Expected behavior Code working with Firebase Emulator
I found a few problems with this issue:
- I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight.
- This issue does not seem to follow the issue template. Make sure you provide all the required information.
@tonyjhuang FYI
This is an emulator issue, created https://github.com/firebase/firebase-tools/issues/5208
@christhompsongoogle I don't have permissions for some reason, mind closing this out?