Skip to content

fix(gcp): use InitializationError instead of panic in gcs-bucket and cloud-function#1061

Closed
Amit2465 wants to merge 1 commit intogruntwork-io:masterfrom
Amit2465:ay/gcp-fix-init-error
Closed

fix(gcp): use InitializationError instead of panic in gcs-bucket and cloud-function#1061
Amit2465 wants to merge 1 commit intogruntwork-io:masterfrom
Amit2465:ay/gcp-fix-init-error

Conversation

@Amit2465
Copy link
Contributor

Description

Fixes the client initialization error handling in gcs-bucket and cloud-function resources. Both were using panic() when the GCP client failed to initialize, which would crash the process if the API is disabled. Updated to set r.InitializationError and return instead.

TODOs

  • Run the relevant tests successfully, including pre-commit checks.
  • Include release notes. If this PR is backward incompatible, include a migration guide.

Release Notes (draft)

Updated gcs-bucket and cloud-function to gracefully handle client initialization failures instead of panicking.

@Amit2465 Amit2465 requested a review from denis256 as a code owner March 13, 2026 21:07
@Amit2465
Copy link
Contributor Author

Hey @james00012, looks like #1062 handles this at the adapter level by adding a recover() in GcpResourceAdapter.Init(), which is a cleaner approach than fixing each resource individually. Closing this PR since it's covered there.

@Amit2465 Amit2465 closed this Mar 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant