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

feat: Add resource ovh_domain_name #837

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

amstuta
Copy link
Contributor

@amstuta amstuta commented Feb 14, 2025

Description

Add resource ovh_domain_name.

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Improvement (improve existing resource(s) or datasource(s))
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update

How Has This Been Tested?

  • Test A: make testacc TESTARGS="-run TestAccResourceDomainName_basic"

Checklist:

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

@amstuta amstuta requested a review from a team as a code owner February 14, 2025 14:34
@amstuta amstuta linked an issue Feb 18, 2025 that may be closed by this pull request
order := data.ToOrder()
setDefaultDomainOrderValues(ctx, order, data.DomainName.ValueString())
if err := orderCreate(order, r.config, "domain", true); err != nil {
resp.Diagnostics.AddError("failed to create order", err.Error())
Copy link
Contributor

Choose a reason for hiding this comment

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

Shouldn't we return here?


serviceName := data.DomainName.ValueString()

serviceID, err := serviceIdFromResourceName(r.config.OVHClient, serviceName)
Copy link
Member

Choose a reason for hiding this comment

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

/services service name are not unique, meaning that domain name will have the same service name than the web hosting attached to the domain name, or the dns zone

As here

return serviceIds[0], nil
, we are returning the first service, we might not delete the right one.

We need to make serviceIdFromResourceName evolve to handle "serviceType"


```hcl
resource "ovh_domain_name" "domain" {
domain_name = "a-great-domain.ovh"
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
domain_name = "a-great-domain.ovh"
domain_name = "example.com"

Copy link
Member

Choose a reason for hiding this comment

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

We had previous case in Golang code base where they use funny domain name for their tests, and the domain was not registered. Then this domain started to display undesirable content.
Let's stick to example.com here, which is a protected domain for documentation and RFC

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.

New resource: ovh_domain
4 participants