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

Don't fail plan if project,region,zone defaults cannot be retrieved #16135

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 3 additions & 3 deletions google/tpgresource/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -754,7 +754,7 @@ func DefaultProviderProject(_ context.Context, diff *schema.ResourceDiff, meta i
if project := diff.Get("project"); project != nil {
project, err := GetProjectFromDiff(diff, config)
if err != nil {
return fmt.Errorf("Failed to retrieve project, pid: %s, err: %s", project, err)
project = ""
}
err = diff.SetNew("project", project)
if err != nil {
Expand All @@ -771,7 +771,7 @@ func DefaultProviderRegion(_ context.Context, diff *schema.ResourceDiff, meta in
if region := diff.Get("region"); region != nil {
region, err := GetRegionFromDiff(diff, config)
if err != nil {
return fmt.Errorf("Failed to retrieve region, pid: %s, err: %s", region, err)
region = ""
}
err = diff.SetNew("region", region)
if err != nil {
Expand All @@ -789,7 +789,7 @@ func DefaultProviderZone(_ context.Context, diff *schema.ResourceDiff, meta inte
if zone := diff.Get("zone"); zone != nil {
zone, err := GetZoneFromDiff(diff, config)
if err != nil {
return fmt.Errorf("Failed to retrieve zone, pid: %s, err: %s", zone, err)
zone = ""
}
err = diff.SetNew("zone", zone)
if err != nil {
Expand Down