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

Fix import failures on old teams locations #4859

Merged

Conversation

dfialho
Copy link
Contributor

@dfialho dfialho commented Jan 9, 2025

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.

It is not possible to have an integration test for
this now because accounts are not created like
this anymore.

Tested using one of these old accounts: b0b145b6eff5790e74510592c26492cd/6543045645ad4591a4dd9ce3f7cea626

{"id":"6543045645ad4591a4dd9ce3f7cea626","name":"Home","networks":[{"network":"86.20.102.184/32"}],"ip":"2a06:98c1:54::1:d9bb","doh_subdomain":"jjezp4o172","anonymized_logs_enabled":false,"ipv4_destination":"172.64.36.1","ipv4_destination_backup":"172.64.36.2","dns_destination_ips_id":"0e4a32c6-6fb8-4858-9296-98f51631e8e6","client_default":true,"ecs_support":false,"dns_destination_ipv6_block_id":null,"created_at":"2022-04-06T13:23:52Z","updated_at":"2024-03-27T10:13:16Z"}

Closes #4846

@dfialho dfialho requested a review from jacobbednarz as a code owner January 9, 2025 16:12
Copy link
Contributor

github-actions bot commented Jan 9, 2025

changelog detected ✅

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.
@dfialho dfialho force-pushed the dfialho/fix-teams-location-endpoints branch from fba3d6f to 6169aa3 Compare January 9, 2025 16:59
@jacobbednarz
Copy link
Member

acceptance tests all passing

TF_ACC=1 go test ./internal/sdkv2provider -v -run "^TestAccCloudflareTeamsLocation" -count 1 -timeout 120m -parallel 1
=== RUN   TestAccCloudflareTeamsLocationBasic
--- PASS: TestAccCloudflareTeamsLocationBasic (3.33s)
PASS
ok      github.com/cloudflare/terraform-provider-cloudflare/internal/sdkv2provider      5.684s

@jacobbednarz jacobbednarz merged commit 8a39731 into cloudflare:master Jan 13, 2025
7 checks passed
@github-actions github-actions bot added this to the v4.51.0 milestone Jan 13, 2025
Copy link
Contributor

This functionality has been released in v4.51.0 of the Terraform Cloudflare Provider.

Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template. Thank you!

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 22, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

cloudflare_teams_location fails to import default location
2 participants