aboutsummaryrefslogtreecommitdiff
path: root/plugin/autopath/setup.go (follow)
AgeCommit message (Collapse)AuthorFilesLines
2021-05-17reverse zone: fix Normalize (#4621)Gravatar Miek Gieben 1-8/+2
Make normalize return multiple "hosts" (= reverse zones) when a non-octet boundary cidr is given. Added pkg/cidr package that holds the cidr calculation routines; felt they didn't really fit dnsutil. This change means the IPNet return parameter isn't needed, the hosts are all correct. The tests that tests this is also removed: TestSplitHostPortReverse The fallout was that zoneAddr _also_ doesn't need the IPNet member, that in turn make it visible that zoneAddr in address.go duplicated a bunch of stuff from register.go; removed/refactored that too. Created a plugin.OriginsFromArgsOrServerBlock to help plugins do the right things, by consuming ZONE arguments; this now expands reverse zones correctly. This is mostly mechanical. Remove the reverse test in plugin/kubernetes which is a copy-paste from a core test (which has since been fixed). Remove MustNormalize as it has no plugin users. This change is not backwards compatible to plugins that have a ZONE argument that they parse in the setup util. All in-tree plugins have been updated. Signed-off-by: Miek Gieben <miek@miek.nl>
2020-09-24For caddy v1 in our org (#4018)Gravatar Miek Gieben 1-1/+1
* For caddy v1 in our org This RP changes all imports for caddyserver/caddy to coredns/caddy. This is the v1 code of caddy. For the coredns/caddy repo the following changes have been made: * anything not needed by us is deleted * all `telemetry` stuff is deleted * all its import paths are also changed to point to coredns/caddy * the v1 branch has been moved to the master branch * a v1.1.0 tag has been added to signal the latest release Signed-off-by: Miek Gieben <miek@miek.nl> * Fix imports Signed-off-by: Miek Gieben <miek@miek.nl> * Group coredns/caddy with out plugins Signed-off-by: Miek Gieben <miek@miek.nl> * remove this file Signed-off-by: Miek Gieben <miek@miek.nl> * Relax import ordering github.com/coredns is now also a coredns dep, this makes github.com/coredns/caddy fit more natural in the list. Signed-off-by: Miek Gieben <miek@miek.nl> * Fix final import Signed-off-by: Miek Gieben <miek@miek.nl>
2020-07-25using promauto package to ensure all created metrics are properly registered ↵Gravatar Zou Nengren 1-6/+0
(#4025) Signed-off-by: zounengren <zounengren@cmss.chinamobile.com>
2019-09-20all: simply registering plugins (#3287)Gravatar Miek Gieben 1-7/+1
Abstract the caddy call and make it simpler. See #3261 for some part of the discussion. Go from: ~~~ go func init() { caddy.RegisterPlugin("any", caddy.Plugin{ ServerType: "dns", Action: setup, }) } ~~~ To: ~~~ go func init() { plugin.Register("any", setup) } ~~~ This requires some external documents in coredns.io to be updated as well; the old way still works, so it's backwards compatible. Signed-off-by: Miek Gieben <miek@miek.nl>
2019-07-03Update Caddy to 1.0.1, and update import path (#2961)Gravatar Yong Tang 1-1/+1
* Update Caddy to 1.0.1, and update import path This fix updates caddy to 1.0.1 and also updates the import path to github.com/caddyserver/caddy This fix fixes 2959 Signed-off-by: Yong Tang <yong.tang.github@outlook.com> * Also update plugin.cfg Signed-off-by: Yong Tang <yong.tang.github@outlook.com> * Update and bump zplugin.go Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2018-09-19Ensure Re-register of metrics variables after a reload (#2080)Gravatar Francois Tur 1-1/+1
* - 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-08-14Typo fixes (#2031)Gravatar Karsten Weiss 1-1/+1
2018-04-25plugin/autopath: per server metrics (#1730)Gravatar Miek Gieben 1-1/+1
Implement per server metrics in autopath; also don't export the metric. Updated readme as well.
2018-04-01plugin/metrics: add MustRegister function (#1648)Gravatar Miek Gieben 1-9/+1
This registers the Collectors iff the metrics plugin has been loaded. Safes a bunch of code in each and every plugin's setup code.
2017-12-27metrics: correctly register all metrics (#1335)Gravatar Miek Gieben 1-1/+13
After initial startup, see if prometheus is loaded and if so, register our metrics with it. Stop doing the init() func and just use the sync.Once so we don't double registrer our metrics.
2017-12-12Instead of hardcoding plugin lists in autopath/health, use interfaces. (#1306)Gravatar James Hartig 1-16/+4
Switched health and autopath plugin to allow any plugins to be used instead of a hardcoded list. I did not switch federation over since it wasn't obvious that anything other than kubernetes could be used with it. Fixes #1291
2017-10-15plugin/autopath: Add metrics and remove log line (#1143)Gravatar Miek Gieben 1-0/+2
* plugin/autopath: Add namespace selector and metrics Add a namespace, so autopathing only is performed in this namespace. This will make caching work for the cluster again. Also export metrics that we've done a successful autopath * dont shadow * Fix * Back the namespacing changes
2017-09-16More Middleware -> Plugin conversions (#1088)Gravatar Miek Gieben 1-3/+3
Forgot about these.
2017-09-14Remove the word middleware (#1067)Gravatar Miek Gieben 1-0/+93
* Rename middleware to plugin first pass; mostly used 'sed', few spots where I manually changed text. This still builds a coredns binary. * fmt error * Rename AddMiddleware to AddPlugin * Readd AddMiddleware to remain backwards compat