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

DNS record name validation improvements #1740

Merged
merged 4 commits into from Jul 1, 2022
Merged

DNS record name validation improvements #1740

merged 4 commits into from Jul 1, 2022

Conversation

janik-cloudflare
Copy link
Member

@janik-cloudflare janik-cloudflare commented Jun 30, 2022

  • Rename validateRecordName to validateRecordContent to more accurately reflect its purpose (and update error messages).
  • Add a validation to ensure that DNS record names are non-empty.

Closes #1621

@github-actions
Copy link
Contributor

github-actions bot commented Jun 30, 2022

changelog detected ✅

janik-cloudflare and others added 3 commits June 30, 2022 10:00
The API has changed the error response and was previously relying on the
string in the API response to determine when to remove it. Swapping over
to using `*cloudflare.NotFoundError` now that it exists.

Closes #1621
@jacobbednarz
Copy link
Member

acceptance tests are all passing

TF_ACC=1 go test $(go list ./...) -v -run "^TestAccCloudflareRecord_" -count 1 -parallel 1 -timeout 120m -parallel 1
?       github.com/cloudflare/terraform-provider-cloudflare     [no test files]
=== RUN   TestAccCloudflareRecord_Import
--- PASS: TestAccCloudflareRecord_Import (17.94s)
=== RUN   TestAccCloudflareRecord_Basic
=== PAUSE TestAccCloudflareRecord_Basic
=== RUN   TestAccCloudflareRecord_CaseInsensitive
=== PAUSE TestAccCloudflareRecord_CaseInsensitive
=== RUN   TestAccCloudflareRecord_Apex
=== PAUSE TestAccCloudflareRecord_Apex
=== RUN   TestAccCloudflareRecord_LOC
=== PAUSE TestAccCloudflareRecord_LOC
=== RUN   TestAccCloudflareRecord_SRV
=== PAUSE TestAccCloudflareRecord_SRV
=== RUN   TestAccCloudflareRecord_CAA
=== PAUSE TestAccCloudflareRecord_CAA
=== RUN   TestAccCloudflareRecord_Proxied
=== PAUSE TestAccCloudflareRecord_Proxied
=== RUN   TestAccCloudflareRecord_Updated
=== PAUSE TestAccCloudflareRecord_Updated
=== RUN   TestAccCloudflareRecord_typeForceNewRecord
=== PAUSE TestAccCloudflareRecord_typeForceNewRecord
=== RUN   TestAccCloudflareRecord_hostnameForceNewRecord
=== PAUSE TestAccCloudflareRecord_hostnameForceNewRecord
=== RUN   TestAccCloudflareRecord_CreateAfterManualDestroy
=== PAUSE TestAccCloudflareRecord_CreateAfterManualDestroy
=== RUN   TestAccCloudflareRecord_TtlValidation
=== PAUSE TestAccCloudflareRecord_TtlValidation
=== RUN   TestAccCloudflareRecord_ExplicitProxiedFalse
=== PAUSE TestAccCloudflareRecord_ExplicitProxiedFalse
=== RUN   TestAccCloudflareRecord_MXWithPriorityZero
=== PAUSE TestAccCloudflareRecord_MXWithPriorityZero
=== RUN   TestAccCloudflareRecord_TtlValidationUpdate
=== PAUSE TestAccCloudflareRecord_TtlValidationUpdate
=== CONT  TestAccCloudflareRecord_Basic
--- PASS: TestAccCloudflareRecord_Basic (10.95s)
=== CONT  TestAccCloudflareRecord_typeForceNewRecord
--- PASS: TestAccCloudflareRecord_typeForceNewRecord (18.90s)
=== CONT  TestAccCloudflareRecord_TtlValidationUpdate
--- PASS: TestAccCloudflareRecord_TtlValidationUpdate (12.96s)
=== CONT  TestAccCloudflareRecord_MXWithPriorityZero
--- PASS: TestAccCloudflareRecord_MXWithPriorityZero (8.39s)
=== CONT  TestAccCloudflareRecord_ExplicitProxiedFalse
--- PASS: TestAccCloudflareRecord_ExplicitProxiedFalse (20.36s)
=== CONT  TestAccCloudflareRecord_TtlValidation
--- PASS: TestAccCloudflareRecord_TtlValidation (3.63s)
=== CONT  TestAccCloudflareRecord_CreateAfterManualDestroy
--- PASS: TestAccCloudflareRecord_CreateAfterManualDestroy (15.76s)
=== CONT  TestAccCloudflareRecord_hostnameForceNewRecord
--- PASS: TestAccCloudflareRecord_hostnameForceNewRecord (17.70s)
=== CONT  TestAccCloudflareRecord_SRV
--- PASS: TestAccCloudflareRecord_SRV (8.70s)
=== CONT  TestAccCloudflareRecord_Updated
--- PASS: TestAccCloudflareRecord_Updated (17.75s)
=== CONT  TestAccCloudflareRecord_Proxied
--- PASS: TestAccCloudflareRecord_Proxied (9.85s)
=== CONT  TestAccCloudflareRecord_CAA
--- PASS: TestAccCloudflareRecord_CAA (15.10s)
=== CONT  TestAccCloudflareRecord_LOC
--- PASS: TestAccCloudflareRecord_LOC (9.10s)
=== CONT  TestAccCloudflareRecord_CaseInsensitive
--- PASS: TestAccCloudflareRecord_CaseInsensitive (12.45s)
=== CONT  TestAccCloudflareRecord_Apex
--- PASS: TestAccCloudflareRecord_Apex (8.60s)
PASS
ok      github.com/cloudflare/terraform-provider-cloudflare/internal/provider   208.651s
?       github.com/cloudflare/terraform-provider-cloudflare/tools/cmd/changelog-check   [no test files]
?       github.com/cloudflare/terraform-provider-cloudflare/tools/cmd/maintainer-only-file-check        [no test files]
?       github.com/cloudflare/terraform-provider-cloudflare/tools/cmd/tf-log-check      [no test files]
?       github.com/cloudflare/terraform-provider-cloudflare/version     [no test files]

@jacobbednarz jacobbednarz merged commit 4f34fc1 into cloudflare:master Jul 1, 2022
@github-actions github-actions bot added this to the v3.19.0 milestone Jul 1, 2022
github-actions bot pushed a commit that referenced this pull request Jul 1, 2022
@janik-cloudflare janik-cloudflare deleted the rec-name-validation branch July 1, 2022 07:04
@github-actions
Copy link
Contributor

This functionality has been released in v3.19.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!

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.

cloudflare_record does not handle deletion outside of Terraform
2 participants