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:
parent
06efc07f46
commit
53d1afbaf2
3 changed files with 26 additions and 2 deletions
|
@ -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()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue