Commit graph

1629 commits

Author SHA1 Message Date
Miek Gieben
848a5d7c79
Only check 1.10 again (#1652)
This double checking for 1.9 and 1.10 is nice, but doubles the
travis test duration.
2018-04-01 16:18:38 +01:00
Miek Gieben
81348b420b
plugin/forward: TCP conns can be closed (#1651)
* plugin/forward: TCP conns can be closed

Only when we read and get a io.EOF we know the conn is closed (for TCP).
If this is the case Dial (again) and retry. Note that this new
connection can also be closed by the upstream, we may want to add a
DialForceNew or something to get a new TCP connection..

Simular to #1624, *but* this is by (TCP) design. We also don't have to
wait for a timeout which makes it easier to reason about.

* Move to forward.go

* doesnt need changing
2018-04-01 16:18:21 +01:00
Miek Gieben
f5435b3884
make: use dns 1.0.5 (#1649)
Tagged an new release; has some fixes.
2018-04-01 14:29:59 +01:00
Miek Gieben
5f98e98107
plugin/proxy: return client error (#1646)
Return the client error if there was one instead of the generic
"no healthy upstream or error"
2018-04-01 14:23:40 +01:00
Miek Gieben
2338120f5b
plugin/metrics: add MustRegister function (#1648)
This registers the Collectors iff the metrics plugin has been loaded.
Safes a bunch of code in each and every plugin's setup code.
2018-04-01 13:58:13 +01:00
Miek Gieben
4df416ca1d
Metrics (#1579)
* plugin/metrics: set server address in context

Allow cross server block metrics to co-exist; for this we should label
each metric with the server label. Put this information in the context
and provide a helper function to get it out.

Abstracting with entirely away with difficult as the release client_go
(0.8.0) doesn't have the CurryWith functions yet. So current use is like
so:

define metric, with server label:

	RcodeCount = prometheus.NewCounterVec(prometheus.CounterOpts{
		Namespace: plugin.Namespace,
		Subsystem: "forward",
		Name:      "response_rcode_count_total",
		Help:      "Counter of requests made per upstream.",
	}, []string{"server", "rcode", "to"})

And report ith with the helper function metrics.WithServer:

	RcodeCount.WithLabelValues(metrics.WithServer(ctx), rc, p.addr).Add(1)
2018-04-01 13:57:03 +01:00
Miek Gieben
5c5a98ee29
request.Do: use pointer to bool (#1632)
Drop the doTrue and doFalse and use a pointer to a bool to do a proper
tri-bool.
2018-03-31 17:22:24 +01:00
Miek Gieben
fd1501e918
plugin/{forward,proxy}: check for truncated (#1644)
Check for trunacted in the lookup function as well and use the Match
function here as well.
2018-03-31 15:31:03 +01:00
Ruslan Drozhdzh
f19a3b24ca plugin/forward: improve tls configuration (#1643) 2018-03-30 14:35:09 +01:00
Uladzimir Trehubenka
0e0a641f16 Fixed NewServer() init logic (#1637) 2018-03-27 16:32:21 +01:00
Miek Gieben
6d272e3174
plugin/forward: set the RD bit in the hc (#1639)
My routers acts funny when it sees it non RD query; make this HC as
boring as possible
2018-03-26 21:23:33 +01:00
Miek Gieben
231c2c0ef3 Release 1.1.1 2018-03-25 17:22:09 +01:00
Miek Gieben
8e0c7f92c3
Run make -f Makefile.doc (#1635) 2018-03-25 17:18:04 +01:00
Miek Gieben
5616fcb175
Fix dns-01-003 (#1634)
* plugin/{cache,forward,proxy}: don't allow responses that are bogus

Responses that are not matching what we've been querying for should be
dropped. They are converted into FormErrs by forward and proxy; as a 2nd
backstop cache will also not cache these.

* plug

* add explicit test
2018-03-25 17:11:10 +01:00
John Belamaric
91413c25e1 Make examples complete Corefiles (#1623) 2018-03-25 16:48:57 +01:00
Miek Gieben
a8d02d970c
request.Scrub: test for rl==size case (#1631)
* request.Scrub: test for rl==size case

Make a test case for the new break statement in Scrub and also
account for the OPT record that may get re-added in SizeAndDo() -
otherwise we may break clients that expect this.

* Fix comment
2018-03-24 11:50:55 +00:00
Mario Kleinsasser
1c6efbd962 Fix #1625 (#1629)
Signed-off-by: Mario Kleinsasser <mario.kleinsasser@gmail.com>
2018-03-23 16:59:06 +00:00
Miek Gieben
93ade7c432 Use underscores in file names (#1620)
Underscore these names.
2018-03-18 13:09:56 +00:00
Miek Gieben
182235458f
Fix start mesg for all protocol (#1617)
Recent bind refactoring missed this:

    grpc://example.com.:1055
    example.com.:1053 on 127.0.0.1

now becomes

    grpc://example.com.:1055 on 127.0.0.1
    example.com.:1053 on 127.0.0.1

If you're using *bind* directive.
2018-03-17 19:04:01 +00:00
Miek Gieben
b813706baf
request: add match function (#1615) 2018-03-15 08:42:49 +00:00
Miek Gieben
3e6489ef67 Remove the deprecate plugins (#1612)
Remove startup and shutdown completely
2018-03-14 21:18:29 +00:00
Yong Tang
55824516bd
Add PTR record support for Route53 plugin (#1606)
This fix adds PTR record support for Route53 plugin

This fix fixes 1595

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2018-03-13 15:10:07 -07:00
Chris O'Haver
e5beb9dbfc Update README.md (#1607) 2018-03-13 16:33:11 -04:00
Miek Gieben
c8d9150079 Release 1.1.0 2018-03-13 14:46:16 +00:00
Miek Gieben
9a82f6952e Run make -f Makefile.doc 2018-03-13 14:42:21 +00:00
Ricardo Katz
3bb4e659b2 Document the service with ClusterIP wildcard (#1605)
This PR documents the trick exposed in coredns/coredns#1357 about using wildcards to get all POD IPs from a service with ClusterIP (as used in 'endpoints')
2018-03-13 14:35:29 +00:00
Yong Tang
3e3d8cc845 Fix incorrect test case in rout53 plugin (#1603)
While looking into route53 plugin I notice the test case
was incorrect and does not really test the reply. This
fix fixes the issue in the test.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2018-03-13 07:06:50 +00:00
Chris O'Haver
0daa03a81f exclude terminating pods (#1602) 2018-03-13 07:06:03 +00:00
Miek Gieben
259df3c850
make -f Makefile.doc (#1600) 2018-03-12 10:13:56 +00:00
Miek Gieben
27f58d8dc6
logging: Don't use PrintF when not needed (#1599)
These log print don't have any verbs, so just use plain Print
2018-03-09 20:42:27 +00:00
Yamil Asusta
87790dd47c Add DD support (#1596) 2018-03-09 15:08:57 -05:00
Miek Gieben
95342dfaad
plugin/kubernetes: make glog log to standard output (#1598)
Jump through all the hoops to make this work.
2018-03-09 19:55:43 +00:00
Miek Gieben
8d27dd7e92
Cleanup Dockerfile further (#1594)
* dockerfile: remove MAINTAINER

is a group effort and the field is deprecated anyways.
Fix comment to ref standard instead of impl. detail.

* link
2018-03-07 13:52:43 +00:00
Miek Gieben
0353abd3f8
plugin/erratic: linkify RFC references (#1593)
Also add Also See Section.
2018-03-07 13:52:32 +00:00
nogoegst
44e9d734f6 Use apk's no-cache flag in Dockerfile (#1591) 2018-03-06 11:29:11 +00:00
Miek Gieben
369bde5adc docs: make -f Makefile.doc (#1589)
Mechanical change; ran the above command.
2018-03-05 11:58:28 -08:00
Miek Gieben
804f745951
plugin/health: make reload work (#1585)
* plugin/health: make reload work

Remove the once.Do from the startup, so we can re-bind the HTTP
listener. Also clarify the usage of health in multiple server blocks
(this is not the best approach - but there isn't a generic solution at
this point).

Manual tested as we lack testing infra, i.e kill -SIGUSR1 and some
CURLing of the health endpoint.

* Readme test fix

* update

* dont need this
2018-03-02 21:40:14 -08:00
Miek Gieben
acf823cd78
Metrics2 (#1588)
* plugin/metrics: still need nil check for shutdown

the second prometheus statement will trigger: (on control-C)

[signal SIGSEGV: segmentation violation code=0x1 addr=0x28 pc=0x94f45a]

goroutine 25 [running]:
github.com/coredns/coredns/plugin/metrics.(*Metrics).OnShutdown(0xc420252000, 0x0, 0x0)
	/home/miek/g/src/github.com/coredns/coredns/plugin/metrics/metrics.go:107 +0x2a
github.com/coredns/coredns/plugin/metrics.(*Metrics).OnShutdown-fm(0x0, 0x0)
	/home/miek/g/src/github.com/coredns/coredns/plugin/metrics/setup.go:39 +0x2a
github.com/mholt/caddy.(*Instance).ShutdownCallbacks(0xc4202c81e0, 0x0, 0x0, 0x0)
	/home/miek/g/src/github.com/mholt/caddy/caddy.go:164 +0xb3
github.com/mholt/caddy.allShutdownCallbacks(0x1743935, 0x8, 0x14a1b40)
	/home/miek/g/src/github.com/mholt/caddy/sigtrap.go:95 +0x10d
github.com/mholt/caddy.executeShutdownCallbacks.func1()
	/home/miek/g/src/github.com/mholt/caddy/sigtrap.go:75 +0x8f
sync.(*Once).Do(0x2256b80, 0xc42036df88)
	/home/miek/upstream/go/src/sync/once.go:44 +0xbe
github.com/mholt/caddy.executeShutdownCallbacks(0x174033f, 0x6, 0x0)
	/home/miek/g/src/github.com/mholt/caddy/sigtrap.go:71 +0x73
github.com/mholt/caddy.trapSignalsCrossPlatform.func1.1()
	/home/miek/g/src/github.com/mholt/caddy/sigtrap.go:61 +0x36
created by github.com/mholt/caddy.trapSignalsCrossPlatform.func1
	/home/miek

* comments on why
2018-03-02 18:17:05 -08:00
Miek Gieben
6cec66ce40
plugin/reload: enable (#1587)
Couldn't revert the original commit, just manually perform the needed
tweaks.
2018-03-02 17:17:26 -08:00
Miek Gieben
6f3a7af548
Metrics reload (#1586)
* wip

* plugin/metrics: fix reload behavior

Fixes #1472
2018-03-02 17:16:25 -08:00
Uladzimir Trehubenka
5546dbf3c6 Added nanoseconds to dnstap plugin builder (#1583) 2018-03-02 04:50:31 -08:00
Miek Gieben
a131c22d24
plugin/health: doc updates (#1582)
Fixes #1564
2018-03-01 18:32:15 -08:00
Miek Gieben
7b93ce2ec1
server: drop logging (#1581)
* server: drop logging

Drop this log line; you have no control over it; it doesn't add that
much and can be used to easily ddos you.

* compile
2018-03-01 17:59:07 -08:00
Miek Gieben
32671bc983 plugin/auto: update some comments typos
Just happen to see these. Fix them.
2018-03-01 17:14:53 -08:00
Miek Gieben
36e86231ad
Fix zone printing (#1578)
Dont return here, but continue
2018-03-01 13:56:19 -08:00
Miek Gieben
50b96fe2ce
deprecate startup/shutdown (#1577)
error on startup when we see these in a corefile:

~~~
% ./coredns
2018/03/01 06:51:23 plugin/startup: this plugin has been deprecated
% ./coredns
2018/03/01 06:51:32 plugin/shutdown: this plugin has been deprecated
~~~
2018-03-01 07:22:08 -08:00
Miek Gieben
d67396dc7b
plugin/deprecated: add an easy way to error on deprecated plugin (#1575)
* plugin/deprecated: add an easy way to error on depcated plugin

* lint

* better docs

* slightly more docs
2018-03-01 06:49:52 -08:00
Miek Gieben
654b88d8c4
just use setup (#1574)
All these functions are namespaced by their package anyway; just use
setup().
2018-02-28 19:56:14 -08:00
Miek Gieben
4f3dc207a4
plugin/file: shutdown reload goroutine (#1571)
* plugin/file: shutdown reload goroutine

Shutdown the z.Reload() routine (if started in the first place) on
shutdow and reload.

Fixes #1508

* Must be put in c.OnShutdown()

* up test coverage
2018-02-28 18:19:37 -08:00
varyoo
6bb08ffee4 Easier way to dnstap? (#1496)
* Easier way to dnstap?

* Remove unnecessary function parameter from Tapper

* golint

* golint 2

* Proxy dnstap tests

* README.md & doc

* net.IP

* Proxy test was incorrect

* Small changes

* Update README.md

* Was not reporting dnstap errors + test

* Wasn't working at all, now it's ok

* Thanks Travis
2018-02-28 18:19:01 -08:00