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

Validate TTL in zone_record to >=60 #397

Merged
merged 3 commits into from
Mar 15, 2023
Merged

Validate TTL in zone_record to >=60 #397

merged 3 commits into from
Mar 15, 2023

Conversation

yomovh
Copy link
Member

@yomovh yomovh commented Mar 9, 2023

Description

the zone record route sets the TTL to 60 (and return 200) even if the request contains a value below. This cause terraform to update the record at each apply.

This patch validates that the TTL set by the user in his script is >= to 60.

Type of change

Please delete options that are not relevant.

  • [x ] Bug fix (non-breaking change which fixes an issue)

This will be a breaking for user that set TTL to a value below 60. However, in that case, their value is not set since the server set the value to 60

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

  • [X ] Test A: make testacc TESTARGS="-run TestAccDomainZoneRecord_Basic"

Checklist:

  • [x ] My code follows the style guidelines of this project
  • [ x] I have performed a self-review of my code
  • [ x] I have commented my code, particularly in hard-to-understand areas
  • [ x] I have made corresponding changes to the documentation
  • [ x] My changes generate no new warnings or issues
  • [ x] I have added acceptance tests that prove my fix is effective or that my feature works
  • [ x] New and existing acceptance tests pass locally with my changes => TestAccDomainZoneRecord_updateType TestAccDomainZoneRecord_Updated
  • [x ] I ran succesfully go mod vendor if I added or modify go.mod file

…request contains a value below. This cause terraform to update the record at each `apply`.

This patch validates that the TTL set by the user in his script is > to 60.
Copy link
Collaborator

@scraly scraly left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks :)
Just a suggestion regarding the error message

ovh/resource_domain_zone_record.go Outdated Show resolved Hide resolved
ovh/resource_domain_zone_record_test.go Outdated Show resolved Hide resolved
Feedback from review on error message wording

Co-authored-by: Aurelie Vache <[email protected]>
@ovh-cds
Copy link
Collaborator

ovh-cds commented Mar 15, 2023

CDS Report terraform-provider-ovh-check#1506.0 ✘
*

  • checks ✘

@ovh-cds
Copy link
Collaborator

ovh-cds commented Mar 15, 2023

CDS Report terraform-provider-ovh-check#1507.0 ✘
*

  • checks ✘

@ovh-cds
Copy link
Collaborator

ovh-cds commented Mar 15, 2023

CDS Report terraform-provider-ovh-testacc#1506.0 ✘
*

  • checks ✘

@ovh-cds
Copy link
Collaborator

ovh-cds commented Mar 15, 2023

CDS Report terraform-provider-ovh-testacc#1507.0 ✘
*

  • checks ✘

Copy link
Collaborator

@scraly scraly left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perfect!

$ terraform apply
╷
│ Error: "ttl" must be greater than or equal to 60, got: 50
│
│   with ovh_domain_zone_record.test,
│   on pr397.tf line 5, in resource "ovh_domain_zone_record" "test":
│    5:   ttl       = 50

@scraly scraly added the 0.29.0 label Mar 15, 2023
@ovh-cds
Copy link
Collaborator

ovh-cds commented Mar 15, 2023

CDS Report terraform-provider-ovh-check#1508.0 ✔
*

  • checks ✔

@ovh-cds
Copy link
Collaborator

ovh-cds commented Mar 15, 2023

CDS Report terraform-provider-ovh-check#1509.0 ✔
*

  • checks ✔

@ovh-cds
Copy link
Collaborator

ovh-cds commented Mar 15, 2023

CDS Report terraform-provider-ovh-testacc#1508.0 ✘
*

  • checks ✘

@ovh-cds
Copy link
Collaborator

ovh-cds commented Mar 15, 2023

CDS Report terraform-provider-ovh-testacc#1509.0 ✘
*

  • checks ✘

@scraly scraly merged commit b016104 into master Mar 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants