mirror of
https://github.com/fsouza/fake-gcs-server.git
synced 2026-04-25 13:45:52 +03:00
[PR #2135] Add support for multiple Pub/Sub notification configurations #2127
Labels
No labels
bug
compatibility-issue
docker
documentation
enhancement
help wanted
needs information
pull-request
question
stale
unfortunate
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/fake-gcs-server#2127
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/fsouza/fake-gcs-server/pull/2135
Author: @lberrymage
Created: 2/4/2026
Status: 🔄 Open
Base:
main← Head:multiple-event-configs📝 Commits (3)
9313f54Add support for multiple Pub/Sub notification configurationsa4601abRequire event.config values to be non-empty5c5f7f8Make event.config tests consistent with event tests📊 Changes
6 files changed (+568 additions, -5 deletions)
View changed files
📝
fakestorage/server.go(+18 -4)📝
fakestorage/server_test.go(+108 -0)📝
internal/config/config.go(+120 -1)📝
internal/config/config_test.go(+181 -0)📝
internal/notification/event.go(+18 -0)📝
internal/notification/event_test.go(+123 -0)📄 Description
fake-gcs-server's flags currently support setting only a single object storage notification configuration, rendering it impossible to model certain system architectures which depend on multiple notification configurations (e.g., a system which sends notifications to different Pub/Sub topics depending on the bucket) even if these architectures are possible with Google Cloud Storage proper.
This commit adds support for specifying a full notification configuration with the -event.config flag using semicolon-separated key-value pairs. The flag can be repeated to add additional notification configurations. Backward compatibility is preserved with the old event.* flags (which can specify only a single notification config) by allowing them to work previously, but ignoring them if the new -event.config flag is used. The list of event types which trigger a notification defaults to "finalize" to match existing behavior with the old -event.* flags.
The implementation uses a new MultiEventManager type which simply wraps a list of PubsubEventManagers. This approach allows for maximum code reuse with minimum code churn, although it might technically be cleaner to altogether replace the implementation of PubsubEventManager with that of MultiEventManager in the future.
Implements #2131
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.