Skip to content

Commit

Permalink
Fix import failures on old teams locations
Browse files Browse the repository at this point in the history
Recently a change was made to teams locations
which adds the "endpoints" field. However, old
locations still don't have that field.

The provider was failing to read these old
locations because it was assuming the field was
there. This was fixed by excluding this field
when not available.
  • Loading branch information
dfialho committed Jan 9, 2025
1 parent 7448437 commit 6169aa3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .changelog/4859.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:bug
resource/cloudflare_teams_location: Fix import failures on teams locations
```
3 changes: 3 additions & 0 deletions internal/sdkv2provider/resource_cloudflare_teams_location.go
Original file line number Diff line number Diff line change
Expand Up @@ -386,6 +386,9 @@ func flattenTeamsLocationNetworksIntoList(networks []cloudflare.TeamsLocationNet
}

func flattenTeamsEndpoints(endpoint *cloudflare.TeamsLocationEndpoints) []interface{} {
if endpoint == nil {
return nil
}
flattenedEndpoints := map[string]interface{}{
"ipv4": flattenTeamsEndpointIpv4Field(endpoint.IPv4Endpoint),
"ipv6": flattenTeamsEndpointIpv6Field(endpoint.IPv6Endpoint),
Expand Down

0 comments on commit 6169aa3

Please sign in to comment.