Commit b46fbbc4 authored by Rostislav M. Georgiev's avatar Rostislav M. Georgiev

kubeadm: Warn on API server bind address override

ChooseAPIServerBindAddress is silently overriding the requested bind IP address for the API server if that address is deemed unsuitable. This is currently done only if the IP is a loopback one (127.0.0.0/8; ::1/128). It's best to at least issue a warning if such override occurs, so that there are no surprised users by this. Signed-off-by: 's avatarRostislav M. Georgiev <rostislavg@vmware.com>
parent 973b5d29
......@@ -19,6 +19,7 @@ package config
import (
"io/ioutil"
"net"
"reflect"
"strings"
"github.com/pkg/errors"
......@@ -175,5 +176,8 @@ func ChooseAPIServerBindAddress(bindAddress net.IP) (net.IP, error) {
}
return nil, err
}
if bindAddress != nil && !bindAddress.IsUnspecified() && !reflect.DeepEqual(ip, bindAddress) {
klog.Warningf("WARNING: overriding requested API server bind address: requested %q, actual %q", bindAddress, ip)
}
return ip, nil
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment