提交 9830d91c 编写于 作者: S Sharif Elgamal

linting nonsense

上级 adc1a569
......@@ -17,6 +17,7 @@ limitations under the License.
package cmd
import (
"github.com/golang/glog"
"github.com/spf13/cobra"
"github.com/spf13/viper"
"k8s.io/minikube/pkg/minikube/cluster"
......@@ -24,6 +25,7 @@ import (
"k8s.io/minikube/pkg/minikube/exit"
"k8s.io/minikube/pkg/minikube/machine"
"k8s.io/minikube/pkg/minikube/node"
"k8s.io/minikube/pkg/minikube/out"
)
var nodeDeleteCmd = &cobra.Command{
......@@ -53,10 +55,16 @@ var nodeDeleteCmd = &cobra.Command{
}
if cluster.IsHostRunning(api, name) {
node.Stop(cc, n)
err := node.Stop(cc, n)
if err != nil {
glog.Warningf("Failed to stop node, will still try to delete")
}
}
node.Delete(cc, name)
err = node.Delete(cc, name)
if err != nil {
out.FatalT("Failed to delete node {{.name}}", out.V{"name": name})
}
},
}
......
......@@ -61,7 +61,10 @@ var nodeStartCmd = &cobra.Command{
}
// Start it up baby
node.Start(cc, n, false, nil)
_, err = node.Start(cc, n, false, nil)
if err != nil {
out.FatalT("Failed to start node {{.name}}", out.V{"name": name})
}
},
}
......
......@@ -59,7 +59,10 @@ var nodeStopCmd = &cobra.Command{
exit.WithError("retrieving node", err)
}
node.Stop(cc, n)
err = node.Stop(cc, n)
if err != nil {
out.FatalT("Failed to stop node {{.name}}", out.V{"name": name})
}
},
}
......
......@@ -942,8 +942,3 @@ func getKubernetesVersion(old *config.MachineConfig) string {
}
return nv
}
// saveConfig saves profile cluster configuration in $MINIKUBE_HOME/profiles/<profilename>/config.json
func saveConfig(clusterCfg *config.MachineConfig) error {
return config.SaveProfile(viper.GetString(config.MachineProfile), clusterCfg)
}
......@@ -198,8 +198,8 @@ func adjustGuestClock(h hostRunner, t time.Time) error {
// machineExists checks if virtual machine does not exist
// if the virtual machine exists, return true
func machineExists(Driver string, s state.State, err error) (bool, error) {
switch Driver {
func machineExists(d string, s state.State, err error) (bool, error) {
switch d {
case driver.HyperKit:
if s == state.Stopped || err.Error() == "connection is shut down" {
return false, ErrorMachineNotExist
......
......@@ -26,7 +26,6 @@ import (
const (
imageRepository = "image-repository"
force = "force"
cacheImages = "cache-images"
waitUntilHealthy = "wait"
cacheImageConfigKey = "cache"
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册