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

Provider GoDaddy fix domain update #3427

Merged
merged 5 commits into from
Jun 16, 2023
Merged

Provider GoDaddy fix domain update #3427

merged 5 commits into from
Jun 16, 2023

Conversation

nefelim4ag
Copy link
Contributor

@nefelim4ag nefelim4ag commented Feb 21, 2023

Description

(I'm not Go dev so sorry if I do it too wrong)
Fix handling of second-level domains like example.com
Handle it in an obvious way because the old check was not supposed for that.
GoDaddy API used in the right way: https://developer.godaddy.com/doc/endpoint/domains
Check changes and only apply what actually changed.
Use PUT for record replacement (API doesn't allow partial updates or deletes).

Additionally:

  • some simple rate limit handling (I have much more than 60 domains, and just realize that while debugging).
  • Fix misleading Discard message, because as an end-user I several times got bald
  • Tested on my environments, docker image: public.ecr.aws/xflow-ltd/external-dns:0.13.5

Old log, with lost of TXT records and broken dns

time="2021-12-08T12:32:44Z" level=warning msg="GoDaddy: record in zone apvcascade.dev not found apvcascade.dev 600 IN A 54.74.22.121 to delete"
time="2021-12-08T12:32:45Z" level=error msg="Add record apvcascade.dev.apvcascade.dev of type A failed: {\"code\":\"\"}"
time="2021-12-08T12:32:45Z" level=error msg="Unable to apply change create on record apvcascade.dev 600 IN A 34.245.127.123, Error DUPLICATE_RECORD: \"Another record with the same attributes already exists\""
time="2021-12-08T12:32:45Z" level=error msg="Error DUPLICATE_RECORD: \"Another record with the same attributes already exists\""
time="2021-12-08T12:33:45Z" level=info msg="GoDaddy: 4 zones found"

New log:

{"level":"info","msg":"GoDaddy: 6 changes will be done","time":"2023-02-22T18:32:34+01:00"}
{"level":"debug","msg":"GoDaddy: Delete an entry @ 600 IN A 34.246.198.255 to zone hdomain.dev","time":"2023-02-22T18:32:34+01:00"}
{"level":"debug","msg":"GoDaddy: Delete an entry @ 600 IN A 54.155.26.162 to zone hdomain.dev","time":"2023-02-22T18:32:34+01:00"}
{"level":"error","msg":"Delete record @.hdomain.dev of type A failed: {\"code\":\"\"}","time":"2023-02-22T18:32:34+01:00"}
{"level":"debug","msg":"Handle not found - already deleted?","time":"2023-02-22T18:32:34+01:00"}
{"level":"debug","msg":"GoDaddy: Delete an entry @ 600 IN A 54.194.62.197 to zone hdomain.dev","time":"2023-02-22T18:32:34+01:00"}
{"level":"error","msg":"Delete record @.hdomain.dev of type A failed: {\"code\":\"\"}","time":"2023-02-22T18:32:35+01:00"}
{"level":"debug","msg":"Handle not found - already deleted?","time":"2023-02-22T18:32:35+01:00"}
{"level":"debug","msg":"GoDaddy: Delete an entry external-dns 600 IN TXT \"heritage=external-dns,external-dns/owner=eks-dev,external-dns/resource=ingress/med/clickhouse\" to zone hdomain.dev","time":"2023-02-22T18:32:35+01:00"}
{"level":"debug","msg":"Skipping record external-dns.a-hdomain.dev because no hosted zone matching record DNS Name was detected","time":"2023-02-22T18:32:35+01:00"}
{"level":"debug","msg":"GoDaddy: Update an entry @ 600 IN A 54.155.26.162 to zone hdomain.dev","time":"2023-02-22T18:32:35+01:00"}
{"level":"debug","msg":"GoDaddy: Update an entry @ 600 IN A 54.194.250.28 to zone hdomain.dev","time":"2023-02-22T18:32:35+01:00"}
{"level":"debug","msg":"GoDaddy: Update an entry @ 600 IN A 54.194.62.197 to zone hdomain.dev","time":"2023-02-22T18:32:35+01:00"}
{"level":"debug","msg":"GoDaddy: Update an entry external-dns 600 IN TXT \"heritage=external-dns,external-dns/owner=eks-dev,external-dns/resource=ingress/med/clickhouse\" to zone hdomain.dev","time":"2023-02-22T18:32:35+01:00"}
{"level":"debug","msg":"Skipping record external-dns.a-hdomain.dev because no hosted zone matching record DNS Name was detected","time":"2023-02-22T18:32:35+01:00"}
{"level":"debug","msg":"GoDaddy: hdomain.dev zone found","time":"2023-02-22T18:33:34+01:00"}

Fixes #2467

Checklist

  • Unit tests updated
  • End user documentation updated

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Feb 21, 2023
@k8s-ci-robot
Copy link
Contributor

Welcome @nefelim4ag!

It looks like this is your first PR to kubernetes-sigs/external-dns 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes-sigs/external-dns has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. 😃

@k8s-ci-robot k8s-ci-robot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Feb 21, 2023
@nefelim4ag nefelim4ag changed the title GoDaddy fixes Provider GoDaddy fix domain update Feb 24, 2023
@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Mar 3, 2023
@nefelim4ag
Copy link
Contributor Author

Gentle ping:
@seanmalloy
@szuecs

@szuecs
Copy link
Contributor

szuecs commented May 9, 2023

/ok-to-test

@k8s-ci-robot k8s-ci-robot added the ok-to-test Indicates a non-member PR verified by an org member that is safe to test. label May 9, 2023
@szuecs
Copy link
Contributor

szuecs commented May 10, 2023

golangci-lint run --timeout=15m ./...
level=warning msg="[linters_context] rowserrcheck is disabled because of generics. You can track the evolution of the generics support by following the https://github.com/golangci/golangci-lint/issues/2649."
provider/godaddy/client.go:31: File is not `goimports`-ed with -local sigs.k8s.io/external-dns (goimports)
	"golang.org/x/time/rate"
Error: provider/godaddy/client.go:233:30: unnecessary conversion (unconvert)
		jitter := rand.Int63n(int64(retryAfter))
		                           ^
provider/godaddy/godaddy.go:462: unnecessary trailing newline (whitespace)

	}
provider/godaddy/godaddy.go:546: unnecessary trailing newline (whitespace)

	}
make: *** [Makefile:51: go-lint] Error 1

@nefelim4ag
Copy link
Contributor Author

@szuecs done, sorry for the long response

@szuecs
Copy link
Contributor

szuecs commented Jun 16, 2023

/approve
/lgtm

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Nefelim4ag, szuecs

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added lgtm "Looks good to me", indicates that a PR is ready to be merged. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Jun 16, 2023
@k8s-ci-robot k8s-ci-robot merged commit 59d7bfa into kubernetes-sigs:master Jun 16, 2023
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

GoDaddy: broken update root record
3 participants