Move kubeconfig down as we cannot get an IP if host is down

pull/6452/head
Thomas Stromberg 2020-01-31 19:24:30 -08:00
parent edbe92fb01
commit af2060a858
1 changed files with 10 additions and 10 deletions

View File

@ -149,7 +149,16 @@ func status(api libmachine.API, name string) (*Status, error) {
}
st.Host = hs
// We have enough to query kubeconfig now!
// If it's not running, quickly bail out rather than delivering conflicting messages
if st.Host != state.Running.String() {
glog.Infof("host is not running, skipping remaining checks")
st.APIServer = st.Host
st.Kubelet = st.Host
st.Kubeconfig = st.Host
return st, nil
}
// We have a fully operational host, now we can check for details
ip, err := cluster.GetHostDriverIP(api, name)
if err != nil {
glog.Errorln("Error host driver ip status:", err)
@ -170,15 +179,6 @@ func status(api libmachine.API, name string) (*Status, error) {
st.Kubeconfig = Configured
}
// If it's not running, quickly bail out rather than delivering confusing information.
if st.Host != state.Running.String() {
glog.Infof("host is not running, skipping remaining checks")
st.APIServer = st.Host
st.Kubelet = st.Host
return st, nil
}
// At this point, we start executing commands on the cluster for more details
host, err := cluster.CheckIfHostExistsAndLoad(api, name)
if err != nil {
return st, err