aboutsummaryrefslogtreecommitdiff
path: root/plugin
diff options
context:
space:
mode:
authorGravatar Jiacheng Xu <xjcmaxwellcjx@gmail.com> 2018-11-02 22:07:50 +0100
committerGravatar Miek Gieben <miek@miek.nl> 2018-11-02 21:07:50 +0000
commit165b4f86a37f40eb265761d1ca782184b0f36fd0 (patch)
tree45f4930589a36e517cee0d2670776cdcc27e147b /plugin
parent1a01e13db881d3b75cd31bf2a3564900d5b67d5b (diff)
downloadcoredns-165b4f86a37f40eb265761d1ca782184b0f36fd0.tar.gz
coredns-165b4f86a37f40eb265761d1ca782184b0f36fd0.tar.zst
coredns-165b4f86a37f40eb265761d1ca782184b0f36fd0.zip
plugin/route53: make the upstream address in route53 plugin optional. (#2263)
* Make the upstream in route53 plugin optional. Signed-off-by: Jiacheng Xu <xjcmaxwellcjx@gmail.com> * Add 2 tests for upstream in route53. Signed-off-by: Jiacheng Xu <xjcmaxwellcjx@gmail.com> * Change the readme. Signed-off-by: Jiacheng Xu <xjcmaxwellcjx@gmail.com>
Diffstat (limited to 'plugin')
-rw-r--r--plugin/route53/README.md2
-rw-r--r--plugin/route53/setup.go5
-rw-r--r--plugin/route53/setup_test.go11
3 files changed, 10 insertions, 8 deletions
diff --git a/plugin/route53/README.md b/plugin/route53/README.md
index 32628d81d..5917e03f8 100644
--- a/plugin/route53/README.md
+++ b/plugin/route53/README.md
@@ -32,7 +32,7 @@ route53 [ZONE:HOSTED_ZONE_ID...] {
* `upstream` [**ADDRESS**...] specifies upstream resolver(s) used for resolving services that point
to external hosts (eg. used to resolve CNAMEs). If no **ADDRESS** is given, CoreDNS will resolve
against itself. **ADDRESS** can be an IP, an IP:port or a path to a file structured like
- resolv.conf (**NB**: Currently a bug (#2099) is preventing the use of self-resolver).
+ resolv.conf.
* `credentials` used for reading the credential file and setting the profile name for a given zone.
* **PROFILE** AWS account profile name. Defaults to `default`.
* **FILENAME** AWS credentials filename. Defaults to `~/.aws/credentials`
diff --git a/plugin/route53/setup.go b/plugin/route53/setup.go
index e016272ca..b293a320b 100644
--- a/plugin/route53/setup.go
+++ b/plugin/route53/setup.go
@@ -84,11 +84,6 @@ func setup(c *caddy.Controller, f func(*credentials.Credentials) route53iface.Ro
})
case "upstream":
args := c.RemainingArgs()
- // TODO(dilyevsky): There is a bug that causes coredns to crash
- // when no upstream endpoint is provided.
- if len(args) == 0 {
- return c.Errf("local upstream not supported. please provide upstream endpoint")
- }
var err error
up, err = upstream.New(args)
if err != nil {
diff --git a/plugin/route53/setup_test.go b/plugin/route53/setup_test.go
index 98d7b2bce..99310dce4 100644
--- a/plugin/route53/setup_test.go
+++ b/plugin/route53/setup_test.go
@@ -36,10 +36,17 @@ func TestSetupRoute53(t *testing.T) {
}
c = caddy.NewTestController("dns", `route53 example.org:12345678 {
+ upstream 10.0.0.1
+}`)
+ if err := setup(c, f); err != nil {
+ t.Fatalf("Expected no errors, but got: %v", err)
+ }
+
+ c = caddy.NewTestController("dns", `route53 example.org:12345678 {
upstream
}`)
- if err := setup(c, f); err == nil {
- t.Fatalf("Expected errors, but got: %v", err)
+ if err := setup(c, f); err != nil {
+ t.Fatalf("Expected no errors, but got: %v", err)
}
c = caddy.NewTestController("dns", `route53 example.org:12345678 {