diff options
author | 2019-01-13 10:09:51 -0800 | |
---|---|---|
committer | 2019-01-13 10:09:51 -0800 | |
commit | 7bd6855155eabe6369c5f3b440299be1aadd7170 (patch) | |
tree | 8726eeb2a18e1d8d2a6f43051f030b2aaebf85b0 /plugin/kubernetes/setup.go | |
parent | f655d404d45d2ca31491f846818f671c6a3b5a5d (diff) | |
download | coredns-7bd6855155eabe6369c5f3b440299be1aadd7170.tar.gz coredns-7bd6855155eabe6369c5f3b440299be1aadd7170.tar.zst coredns-7bd6855155eabe6369c5f3b440299be1aadd7170.zip |
Deprecate multiple endpoints for out-of-cluster k8s api (#2454)
This fix deprecates endpoints for out-of-cluster k8s api,
The Corefile still takes multiple endpoints though only
the first one is used. A warning is shown if there are
multiple endpoints.
Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Diffstat (limited to 'plugin/kubernetes/setup.go')
-rw-r--r-- | plugin/kubernetes/setup.go | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/plugin/kubernetes/setup.go b/plugin/kubernetes/setup.go index 5ea62246f..faf0f8ca3 100644 --- a/plugin/kubernetes/setup.go +++ b/plugin/kubernetes/setup.go @@ -195,15 +195,11 @@ func ParseStanza(c *caddy.Controller) (*Kubernetes, error) { case "endpoint": args := c.RemainingArgs() if len(args) > 0 { + // Multiple endoints are deprecated but still could be specified, + // only the first one be used, though k8s.APIServerList = args if len(args) > 1 { - // If multiple endoints specified, then only http allowed - for i := range args { - parts := strings.SplitN(args[i], "://", 2) - if len(parts) == 2 && parts[0] != "http" { - return nil, fmt.Errorf("multiple endpoints can only accept http, found: %v", args[i]) - } - } + log.Warningf("Multiple endpoints have been deprecated, only the first specified endpoint '%s' is used", args[0]) } continue } |