Commit graph

409 commits

Author SHA1 Message Date
Miek Gieben
c8fb66f8cc
Revert "plugin/log: Change time format to be consistent with pkg/log (#2135)" (#2179)
This reverts commit ae2a0c62b7.
2018-10-10 22:32:19 +01:00
Chris O'Haver
974ed086f2 use keys (#2167) 2018-10-10 12:28:45 -07:00
Can Yucel
8432f14207 plugin/route53: add split zone support (#2160)
Automatically submitted.
2018-10-10 17:55:54 +00:00
Miek Gieben
830e97f800
plugin/kubernetes: allow trimming down of cached items. (#2128)
* Convert to runtime.Object to smaller structs

This adds conversion for all the objects we want to keep in the cache.
It keeps the minimum for CoreDNS to function and throws away the rest.

The conversion:
api.Endpoints -> object.Endpoints
api.Pod       -> object.Pod
api.Serivce   -> object.Service

We needed to copy some client-go stuff to insert a conversion function
into NewIndexInformers.

Some unrelated cleanups in the watch functionality as that needed to be
touched because of the above translation of objects.

Signed-off-by: Miek Gieben <miek@miek.nl>

* Reduce test line-count

Signed-off-by: Miek Gieben <miek@miek.nl>

* ....and fix test

Signed-off-by: Miek Gieben <miek@miek.nl>

* Drop use of append

Signed-off-by: Miek Gieben <miek@miek.nl>

* cosmetic changes

Signed-off-by: Miek Gieben <miek@miek.nl>

* that was a typo

Signed-off-by: Miek Gieben <miek@miek.nl>

* re-introduce append here

We can't really use len() here because we don't know the number before
hand.

Signed-off-by: Miek Gieben <miek@miek.nl>

* comment in better place

Signed-off-by: Miek Gieben <miek@miek.nl>

* Make the timestamp a bool; thats where it is used for

Signed-off-by: Miek Gieben <miek@miek.nl>

* Set incoming object to nil

Explicataliy discard the converted object; we did a deep copy it's
not needed anymore.

Signed-off-by: Miek Gieben <miek@miek.nl>

* Per Chris's comment

Signed-off-by: Miek Gieben <miek@miek.nl>
2018-10-09 21:56:09 +01:00
Ruslan Drozhdzh
298b860a97 plugin/forward: fix healthchecker crash (#2165) 2018-10-09 20:50:30 +01:00
Nic Cope
8a9c6174fc Add request and response context to traces (#2162)
Automatically submitted.
2018-10-05 20:13:16 +00:00
John Belamaric
1018a8267a Add Kubernetes auth providers (#2147)
* Import auth providers for K8s

* Vendor updates for K8s auth providers

* Remove Azure since it is not compiling

* Update vendor to remove Azure dependencies
2018-10-02 18:50:35 +01:00
marqc
552aab723c Configurable zone reload interval in file plugin (#2110)
* Configurable zone reload interval in file plugin

* passing reload config from auto plugin to file plugin. removed noReload property from Zone struct. fixed tests based on short file reload hack
2018-09-29 16:50:49 +01:00
Brad Beam
a80ec6096f Benchmark for k8s services (#2107)
* Benchmark for k8s services

* Adding k8s.io/client-go/kubernetes/fake dep
2018-09-29 16:43:09 +01:00
Zach Eddy
fe5c731047 Support for kubeconfig files (#2053)
* Add support for authentication with kubeconfig files

* Update k8s plugin documentation

* Fix whitespace in README and tests

* Use clientcmd package to load kubeconfig file
2018-09-28 12:18:55 -07:00
Eugen Kleiner
ae2a0c62b7 plugin/log: Change time format to be consistent with pkg/log (#2135) 2018-09-27 07:52:08 +01:00
Can Yucel
8148408301 plugins/route53: add AWS credentials file support (#2118)
Automatically submitted.
2018-09-25 22:57:16 +00:00
Can Yucel
8d4378d712 plugin/route53: add fallthrough (#2132)
Automatically submitted.
2018-09-25 18:41:05 +00:00
Miek Gieben
6f966eed41
plugin/kubernetes: use struct{} was map values (#2125)
This takes less space than a bool, the value isn't used for anything
else than "present in map" any way.

Signed-off-by: Miek Gieben <miek@miek.nl>
2018-09-22 18:13:33 +01:00
Miek Gieben
f98db6b637 plugin/kubernetes: remove unnecessary checks (#2124)
These checks are not needed and also use a var for all obj errors.

Signed-off-by: Miek Gieben <miek@miek.nl>
2018-09-22 08:54:06 -07:00
Miek Gieben
79eec38afd
plugin/kubernetes: remove var namespace (#2122)
* WIP: trying stuff out

Signed-off-by: Miek Gieben <miek@miek.nl>

* Fixes

Signed-off-by: Miek Gieben <miek@miek.nl>

* Revert "WIP: trying stuff out"

This reverts commit a18a6ae123.
2018-09-22 16:08:21 +01:00
Miek Gieben
7b078a885f
plugin/rewrite: silence these tests (#2120)
* plugin/rewrite: silence these tests

The old Unix saying: no news, is good news.

Signed-off-by: Miek Gieben <miek@miek.nl>

* Fix da tests

Signed-off-by: Miek Gieben <miek@miek.nl>
2018-09-22 15:28:13 +01:00
Miek Gieben
9546b606cb
K8s remove string ops (#2119)
* plugin/kubernetes: remove bunch a string ops

This removes a bunch of appends to where not needed, makes dnsutil.Join
take variadic args which removes the need to wrap in a new string slice.

Signed-off-by: Miek Gieben <miek@miek.nl>

* Fix calls to dnsutil.Join

Signed-off-by: Miek Gieben <miek@miek.nl>

* Revert these

Signed-off-by: Miek Gieben <miek@miek.nl>
2018-09-22 15:12:02 +01:00
Can Yucel
b3d69f1c7f plugin/route53: fix multiple route 53 zones issue (#2117) 2018-09-22 13:26:17 +01:00
Miek Gieben
1697ab359d
Add test for #2003 (#2115)
This adds a test for cleanup in c349446a

Signed-off-by: Miek Gieben <miek@miek.nl>
2018-09-22 13:25:31 +01:00
Miek Gieben
aea2e9f62e plugin/health: close codeblock
Codeblock wasn't properly closed in the README.

Signed-off-by: Miek Gieben <miek@miek.nl>
2018-09-19 10:36:41 -04:00
Francois Tur
f9bdd382dd Ensure Re-register of metrics variables after a reload (#2080)
* - ensure plugins that use prometheus.MustRegister, re-register after reload
- removing once.Do on the startup function was simplest way to do it.

* - fix underscored names (advice of bot)

* - tune existing UT for reload, and add a test verifying failing reload does not prevent correct registering for metrics

* - ensure different ports for tests that can run in same time ..
2018-09-19 02:11:24 -07:00
Miek Gieben
cb932ca231
Better naming (#2104)
* Move functions from pkg/transport to pkg/parse

Although "parse" is a fairly generic name I believe this is somewhat
better named. pkg/transport keeps a few constants that are uses
throughout for the rest is is renaming a bunch (and the fallout from
there to make things compile again).

Signed-off-by: Miek Gieben <miek@miek.nl>

* Fix tests

Signed-off-by: Miek Gieben <miek@miek.nl>
2018-09-19 08:16:04 +01:00
Miek Gieben
c349446a23
Cleanup ParseHostOrFile (#2100)
Create plugin/pkg/transport that holds the transport related functions.
This needed to be a new pkg to prevent cyclic import errors.

This cleans up a bunch of duplicated code in core/dnsserver that also
tried to parse a transport (now all done in transport.Parse).

Signed-off-by: Miek Gieben <miek@miek.nl>
2018-09-19 07:29:37 +01:00
Chris O'Haver
2f1223c36a
Move suffix example out of EDNS0 section (#2102) 2018-09-17 16:41:38 -04:00
dilyevsky
153bd5f767
[plugin/route53]: Support batch mode operation. (#2050)
* [plugin/route53]: Support batch mode operation.

Cache all Route53 records internally using `ListResourceRecordPagesWithContext`
and serve them from memory.

Bonus features:

  * Support additional r53 record types (`CNAME`, `SOA`, etc)
  * Support `upstream` option (#2099 filed to support argument optionality)

Signed-off-by: Dmitry Ilyevskiy <dmitry.ilyevskiy@getcruise.com>
Signed-off-by: Dmitry Ilyevskiy <ilyevsky@gmail.com>
2018-09-17 11:19:07 -07:00
dilyevsky
4ac06a342b
[plugin/proxy]: Return on WriteMsg err. (#2096)
* [plugin/proxy]: Return on WriteMsg err.

Followup PR on the heels of #2050. Short-circut and log on error from
`WriteMsg`. This will prevent code getting stuck on `ReadMsg` and allow
for easier debugging.

Also simply the `ReadMsg` calling code a little - remove double `Close` (already called above).
2018-09-17 10:21:12 -07:00
dilyevsky
063999551d
Add @dilyevsky to reviewers. (#2094)
* Add @dilyevsky to reviewers.

Per @miekg suggestion on https://github.com/coredns/coredns/pull/2050#pullrequestreview-149538954
adding myself to OWNERS file.

* Also add me into plugin/route53-specific reviewers/approvers.
2018-09-13 15:22:57 -07:00
Chris O'Haver
0bf8b81cb7 plugin/federation: handle missing avail-zone/region labels better (#2092)
* handle missing avail-zone/region labels better

* oops forgot a file
2018-09-12 07:07:24 +01:00
Aaron Riekenberg
b42eae7a04 Add MINTTL parameter to cache configuration. (#2055)
* Add success min TTL parameter to cache.

* Add MINTTL to README.

* Update README.

* Add MINTTL to negative cache.

* Remove unnecessary variable name.

* Address review comments.

* Configure cache in TestCacheZeroTTL to have 0 min ttl.
2018-09-03 21:26:02 +02:00
Francois Tur
4c6c9d4b27 Move cache Keys to 64bit for a better dispersion and lower collision frequency (#2077)
* - change Key for cache to 64bits.

* - change Key for cache to 64bits.
2018-08-31 14:26:43 -07:00
Paul G
38051b9089
plugin/rewrite: add handling of TTL field rewrites (#2048)
Resolves: #1981

Signed-off-by: Paul Greenberg <greenpau@outlook.com>
2018-08-29 10:41:03 -04:00
Miek Gieben
ba1efee4f1
Default to scrubbing replies in the server (#2012)
Every plugin needs to deal with EDNS0 and should call Scrub to make a
message fit the client's buffer. Move this functionality into the server
and wrapping the ResponseWriter into a ScrubWriter that handles these
bits for us. Result:

Less code and faster, because multiple chained plugins could all be
calling scrub and SizeAndDo - now there is just one place.

Most tests in file/* and dnssec/* needed adjusting because in those unit
tests you don't see OPT RRs anymore. The DNSSEC signer was also looking
at the returned OPT RR to see if it needed to sign - as those are now
added by the server (and thus later), this needed to change slightly.

Scrub itself still exist (for backward compat reasons), but has been
made a noop. Scrub has been renamed to scrub as it should not be used by
external plugins.

Fixes: #2010

Signed-off-by: Miek Gieben <miek@miek.nl>
2018-08-29 12:26:22 +01:00
Chris O'Haver
684c35d56b lower cache min limit (#2065) 2018-08-29 07:13:18 +01:00
Chris O'Haver
e6ef320d13 handle blank name and namespaces (#2042) 2018-08-27 19:41:04 +01:00
Chris O'Haver
444472891f
plugin/kubernetes: dont transfer unexposed namespaces (#2044)
dont transfer unexposed namespaces
2018-08-27 10:38:49 -04:00
Chris O'Haver
d60993e021
plugin/kubernetes: Create records for portless services (#2052)
inject sentinels for portless services
2018-08-27 10:10:51 -04:00
Bingshen Wang
75f1b9c988 fix kubernetes in-cluster CNAME lookup (#2040)
fix #2038

Signed-off-by: bingshen.wbs <bingshen.wbs@alibaba-inc.com>
2018-08-25 08:53:41 -04:00
Chris O'Haver
610bdc091d
Add suffix example to docs (#2049) 2018-08-23 15:27:09 -04:00
Chris O'Haver
ed85986e70 plugin/kubernetes: Note that deprecated style pod records are not transferred (#2045)
* Update README.md

* Update README.md
2018-08-22 12:28:05 -07:00
Zach Eddy
8aa55c5ff2 Metrics listener fix (#2036)
* Create test to verify correct listener behavior

* Create Unset function to remove todo items

* Reset address for prometheus listener before restarting

* Add inline documentation for Unset function

* Make shutdownTimeout a constant and change to five seconds

* Revert ForEach behavior in uniq package
2018-08-21 11:52:25 -04:00
Eugen Kleiner
b87ed01bb2 plugin/forward: Split setup to reuse it from external plugins (#2034) 2018-08-15 14:24:47 -07:00
Karsten Weiss
6d8a078704 Typo fixes (#2031) 2018-08-14 08:55:55 -07:00
varyoo
9cea32f013 dnstap.TapperFromContext always returns nil (#2018)
Automatically submitted.
2018-08-01 22:58:23 +00:00
Stanislav Zapolsky
2b4878195c fixed typo in kubernetes plugin man page and README. (#2014) 2018-07-30 07:37:24 -07:00
Yong Tang
54ec78c1ba Fix ineffassign (#1959)
* Fix ineffassign

This fix tries to fix ineffassign, as was reported in:
https://goreportcard.com/report/github.com/coredns/coredns#ineffassign

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>

* Update setup.go

Revert this one change, so this can be merged.
2018-07-28 10:32:13 +01:00
Chris O'Haver
992e7928c7 Document current limitations of loop (#1996)
* Document current limitations of loop

* Update README.md
2018-07-23 20:37:41 +01:00
Miek Gieben
b7ae8d4e86
plugin/loop: add missing break (#1992)
The Onstartup loop wouldn't call break after the first success, thereby
sending the query multiple times and halting the process.

Some small other optimizations as well.

Signed-off-by: Miek Gieben <miek@miek.nl>
2018-07-22 11:54:02 +01:00
Miek Gieben
84ec780ffc
New plugin: loop (#1989)
* New plugin: loop

Add a plugin that detects loops. It does this by sending an unique query
to our selves. If we see the query more than twice we stop the process.
If there isn't a loop, the plugin disables it self and becomes a noop
plugin.

Signed-off-by: Miek Gieben <miek@miek.nl>
2018-07-20 19:45:17 +01:00
Miek Gieben
547f155465
Logfatalf (#1990)
* bliep

Signed-off-by: Miek Gieben <miek@miek.nl>

* plugin/log: add log.Fatal[f]

Add log.Fatal(f) to mimic more of the log package. The first and only
use is in the (new) loop plugin.

Signed-off-by: Miek Gieben <miek@miek.nl>
2018-07-20 15:08:06 +01:00