Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Catch PermissionDenied from create_subscription and continue to try t… #263

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

dolfandringa
Copy link

@dolfandringa dolfandringa commented Oct 4, 2023

🎩 What?

Catch PermissionDenied and continue with updating the existing subscription if necessary.

πŸ€” Why?

If the subscription already exists (because it was pre-created) and the service account does not have roles/pubsub.editor permission at the project level, but does have role/pubsub.subscriber on the topic and subscription, the user is not allowed to create a subscription, and the current code will result in an error. Continuing from that error is totally fine though, if the user does have permission to consume the subscription, and update it (if necessary)

πŸ”— Related issue

Closes #262

…o update the existing subscription if necessary
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants