mirror of
https://github.com/coredns/coredns.git
synced 2025-10-29 09:14:17 -04:00
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>
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user