Skip to content

Commit ceca8af

Browse files
modular-magicianshuyama1
authored andcommitted
fix google_client_config (#7953) (#5643)
Signed-off-by: Modular Magician <[email protected]>
1 parent 5429419 commit ceca8af

File tree

2 files changed

+5
-10
lines changed

2 files changed

+5
-10
lines changed

.changelog/7953.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
```release-note:bug
2+
provider: fixed an issue where `google_client_config` datasource return `null` for all attributes when region or zone is unset in provider config
3+
```

google-beta/data_source_google_client_config.go

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -124,16 +124,8 @@ func (d *GoogleClientConfigDataSource) Read(ctx context.Context, req datasource.
124124
}
125125

126126
locationInfo := data.GetLocationDescription(d.providerConfig)
127-
region, err := locationInfo.GetRegion()
128-
if err != nil {
129-
diags.AddError("Error getting region value", err.Error())
130-
return
131-
}
132-
zone, err := locationInfo.GetZone()
133-
if err != nil {
134-
diags.AddError("Error getting zone value", err.Error())
135-
return
136-
}
127+
region, _ := locationInfo.GetRegion()
128+
zone, _ := locationInfo.GetZone()
137129

138130
data.Id = types.StringValue(fmt.Sprintf("projects/%s/regions/%s/zones/%s", d.providerConfig.project.String(), region.String(), zone.String()))
139131
data.Project = d.providerConfig.project

0 commit comments

Comments
 (0)