Commit graph

22 commits

Author SHA1 Message Date
Patrick Gaskin 825ba2d081 Switch to Go 1.13 error wrapping (#604)
* Replaced errors.Wrap with fmt.Errorf (#589)

* Find:    errors\.Wrap\(([^,]+),\s+(["`][^"`]*)(["`])\)
  Replace: fmt.Errorf($2: %w$3, $1)

* Replaced errors.Wrapf with fmt.Errorf (#589)

* Find:    errors\.Wrapf\(([^,]+),\s+(["`][^"`]*)(["`])\)
  Replace: fmt.Errorf($2: %w$3, $1)
* Find:    errors\.Wrapf\(([^,]+),\s+(["`][^"`]*)(["`])(,[^)]+)\)
* Replace: fmt.Errorf($2: %w$3$4, $1)

* Replaced errors.Errorf with fmt.Errorf (#589)

* Find:    errors\.Errorf
  Replace: fmt.Errorf

* Cleaned up remaining imports

* Cleanup

* Regenerate provider support matrix

This was broken by #533 ... and it's now the third time this has been missed.
2020-01-28 11:06:56 -05:00
Patrick Gaskin 2f83aa9302 Internals: Switch to v2 go.mod, drop GOPATH, and fix Azure Pipelines (#595)
* Switched to v2 go.mod

Also set GO111MODULE=on in build stuff to always use Go modules
even when in GOPATH.

* Ensure go.mod, go.sum, and vendor are up to date

* Attempt to fix Azure pipelines

* Add set -e to properly fail on exit (it didn't seem to be
  propagating properly before).
* Set workingDirectory for GoFmt and GoGen (this might be why it
  fails unlike compile and unitests).

* Another attempt to fix Azure Pipelines

* Use the Go env template for all go-related jobs.

* Completely fixed Azure Pipelines

* Added a display name to GoFmt for consistency.
* Fixed diffs for GoFmt and GoGen.
* Show git status for checks.

* Drop GOPATH for tests

TODO: Do the same for integration tests.

* Drop GOPATH for integration tests

* Show more diffs

* Regenerate provider support matrix

This wasn't done in #590...
2020-01-28 10:42:31 -05:00
Patrick Gaskin 70ce16ff23 Fix handling of SRV records with no target (indicated by ".")
According to the RFC, the way to indicate that a SRV has no target is to set the target to ".".  Some providers do not handle this, or the API returns "" instead of ".".  This situation is now tested in the integration tests and all providers (that support this) have been fixed.



* Cloudflare: Fix decoding empty SRV target (fixes #561)

SRV records with empty (".") targets are now returned as false by
the API, which breaks Unmarshaling it into a string.

* Use custom type for Cloudflare SRV target

Rewrote the SRV target decoding to use a custom type for (un)marshaling, as
Cloudflare returns false for null targets, but it requires a single period
for giving it one. The target code has also been made more flexible to future
API changes with additional normalization.

This has been tested with record creation, deletion, and update and works
as of 2019-11-05.

* DigitalOcean: Fix target FQDN for null targets

Without this, dnscontrol thinks an update is needed (.. != .) even
when the SRV target is correct.

* DNSimple: Fix parsing of null SRV target

DNSimple only returns two fields when the target is null.

* NameDotCom: Add note about not supporting null SRV targets, skip test

* DNSimple: Do not append a . unless we have all three parts

Signed-off-by: Amelia Aronsohn <squirrel@wearing.black>

* Regenerated provider matrix
2019-11-14 11:25:20 -05:00
Amy Aronsohn a2c54c85af Update DNSimple-go to v0.20.0 and fix provider (#414)
Signed-off-by: Amy Aronsohn <WagThatTail@Me.com>
2018-10-14 00:30:58 -04:00
Amy Aronsohn 4e417eaa06 Fix DNSimple SRV and MX records (#413)
* Fix SRV and MX records, update knownFailures

This gets us back to tests passing

Signed-off-by: Amy Aronsohn <WagThatTail@Me.com>

* Better comment

Signed-off-by: Amy Aronsohn <WagThatTail@Me.com>
2018-10-14 00:30:13 -04:00
Yoan Blanc 18f47d3291 dnsimple: gofmt (#388)
Signed-off-by: Yoan Blanc <yoan.blanc@exoscale.ch>
2018-08-13 10:41:54 -04:00
Amy Aronsohn a6536264b5 sort returned nameservers (#369)
The API isn't sorting the name servers so even when they match they
would report being different. This will prevent it trying to update them
every time

Signed-off-by: Amy Aronsohn <WagThatTail@Me.com>
2018-06-24 23:37:16 -04:00
Tom Limoncelli a7eba97ada
Refactor in preparation to unexport RecordConfig.{Name,NameFQDN,Target} (#337)
* Preparing for the unexport of Name/NameFQDN/Target
* Cleanups
2018-03-19 17:18:58 -04:00
Tom Limoncelli 32a481b85f
BUG: dnssimple URL broke during refactor (#325) 2018-02-27 16:50:34 -05:00
Tom Limoncelli e266e953d9
Fix DNSimple crashes on Alias: (#322)
* Fix https://github.com/StackExchange/dnscontrol/issues/321
2018-02-27 09:38:39 -05:00
Tom Limoncelli de4455942b
Refactor RecordConfig: Add getters/setters (#314)
* Replace RecordConfig.Name and .NameFQDN with getters and setters.
* Replace RecordConfig.Target with getters and setters.
* Eliminate the CombinedTarget concept.
* Add RecordConfig.PopulateFromString to reduce code in all providers.
* encode and decode name.com txt records (#315)
* Replace fmt.Errorf with errors.Errorf
2018-02-15 12:02:50 -05:00
Tom Limoncelli 4b1dc82c9b
Switch from fmt.Error* to errors.Error* (#317) 2018-02-05 16:17:20 -05:00
Tom Limoncelli b7c251190f
Vet and Lint the entire system (#296)
* govet and golint corrections
2018-01-09 12:53:16 -05:00
Tom Limoncelli de88bfe8b7
Add support for TXT records with multiple strings (BIND, ROUTE53) (#293)
* BIND: Support TXT records with multiple strings (#289)
* ROUTE53: Add support for TXT records with multiple strings (#292)
2018-01-04 19:19:35 -05:00
Tom Limoncelli e7472f76f3 Downcase DNS names (#253)
* Downcase DNS names
* Document opinions
2017-11-07 14:12:17 -08:00
Craig Peterson e548b8f059 DNSimple: Adding SRV, CAA, and ALIAS suppport (#243)
* dnsimple ALIAS

* caa working

* srv

* gen
2017-10-18 15:51:44 -04:00
Craig Peterson 2c5f4c88ea DNSimple: handle pagination appropriately. (#242)
* dnsimple paging

* remove unrelated change
2017-10-18 13:53:44 -04:00
Craig Peterson 3a90435357 Create a dynamic provider features matrix (#201)
* adding simple provider feature matrix generator

* filling out matrix

* clean output

* dead code

* explanatory text

* explanatory text

* typo

* move stuff around

* clean

* editing
2017-09-14 16:13:17 -04:00
Tom Limoncelli d55b20ecdb Add SRV Record Type (#136)
* Add support for SRV records for NAMEDOTCOM and ROUTE53.
* Improve docs
* Rename RR() to ToRR().
* Rename RecordConfig Priority to MxPreference (affects json IR data)
2017-07-19 15:53:40 -04:00
Tom Limoncelli 032750743c DNSIMPLE: Supports PTR records 2017-07-19 14:41:18 -04:00
Craig Peterson 2ac43a424b Letting you run only some tests. Way to document failures in individual providers and skip. 2017-03-22 10:40:47 -06:00
Anthony Eden 4fef4a8550 DNSimple provider (#43)
* Implement a basic DNSimple provider.

Handles domain delegation as well as record create, update, and delete.

Note that this is completely untested at the moment. It’s so alpha it might burn your face off.

* Add some inline comments. Always use the StackExchange libs.

* Clean up dnsimple docs a little

* This will need to be changed before merging.

* Import the dnsimple dnscontrol package from its expected path

* Properly build the FQDN and implement record listing so create/update/delete are used correctly.

* Add support for overriding base URL to allow connection to sandbox.

* Vendor dnsimple-go and its dependencies.

* Remove unnecessary doc file.

* Use dnsutil.AddOrigin for combining record name and origin.

* Modifying dnsimple provider to pass tests
2017-03-18 19:58:47 -06:00