Unverified Commit a82c4903 authored by Evgeny L's avatar Evgeny L Committed by Ilya Dmitrichenko

Fix compilation errors after method GetDefaultHostIP was removed

parent f223d814
......@@ -27,6 +27,7 @@ import (
kubemaster "k8s.io/kubernetes/pkg/kubeadm/master"
kubeadmutil "k8s.io/kubernetes/pkg/kubeadm/util"
cmdutil "k8s.io/kubernetes/pkg/kubectl/cmd/util"
netutil "k8s.io/kubernetes/pkg/util/net"
)
var (
......@@ -59,11 +60,11 @@ func NewCmdInit(out io.Writer, params *kubeadmapi.BootstrapParams) *cobra.Comman
func RunInit(out io.Writer, cmd *cobra.Command, args []string, params *kubeadmapi.BootstrapParams) error {
if params.Discovery.ListenIP == "" {
ip, err := kubeadmutil.GetDefaultHostIP()
ip, err := netutil.ChooseHostInterface()
if err != nil {
return err
}
params.Discovery.ListenIP = ip
params.Discovery.ListenIP = ip.String()
}
if err := kubemaster.CreateTokenAuthFile(params); err != nil {
return err
......
......@@ -98,7 +98,7 @@ func NewCmdManualBootstrapInitMaster(out io.Writer, params *kubeadmapi.Bootstrap
if err != nil {
return fmt.Errorf("Unable to autodetect IP address [%s], please specify with --listen-ip", err)
}
params.Discovery.ListenIP = ip
params.Discovery.ListenIP = ip.String()
}
if err := kubemaster.CreateTokenAuthFile(params); err != nil {
return err
......
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