aboutsummaryrefslogtreecommitdiff
path: root/plugin/kubernetes/setup.go
diff options
context:
space:
mode:
authorGravatar Yong Tang <yong.tang.github@outlook.com> 2019-01-07 09:28:03 -0800
committerGravatar GitHub <noreply@github.com> 2019-01-07 09:28:03 -0800
commit53d1afbaf2bae52ae171f2d85ed9bfc1e54242a4 (patch)
tree10a4fde2ebda27f60ee5d78f7ab931998afdf89a /plugin/kubernetes/setup.go
parent06efc07f46399f2d194614b52d4268a624cfe3eb (diff)
downloadcoredns-53d1afbaf2bae52ae171f2d85ed9bfc1e54242a4.tar.gz
coredns-53d1afbaf2bae52ae171f2d85ed9bfc1e54242a4.tar.zst
coredns-53d1afbaf2bae52ae171f2d85ed9bfc1e54242a4.zip
Error out when multiple https endpoints are specified. (#2438)
This fix will error out when multiple https endpoints are specified, as additional work is needed to support beyond http. This fix fixes 1464. Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Diffstat (limited to 'plugin/kubernetes/setup.go')
-rw-r--r--plugin/kubernetes/setup.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/plugin/kubernetes/setup.go b/plugin/kubernetes/setup.go
index 6928580ba..06939f8f2 100644
--- a/plugin/kubernetes/setup.go
+++ b/plugin/kubernetes/setup.go
@@ -196,6 +196,15 @@ func ParseStanza(c *caddy.Controller) (*Kubernetes, error) {
args := c.RemainingArgs()
if len(args) > 0 {
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])
+ }
+ }
+ }
continue
}
return nil, c.ArgErr()