Commit 9830d91c authored by Sharif Elgamal's avatar Sharif Elgamal

linting nonsense

parent 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)
}
......@@ -61,7 +61,7 @@ func RegisterMockDriver(t *testing.T) {
}
var defaultMachineConfig = config.MachineConfig{
Driver: driver.Mock,
Driver: driver.Mock,
MinikubeISO: constants.DefaultISOURL,
Downloader: MockDownloader{},
DockerEnv: []string{"MOCK_MAKE_IT_PROVISION=true"},
......@@ -262,7 +262,7 @@ func TestStartHostConfig(t *testing.T) {
provision.SetDetector(md)
config := config.MachineConfig{
Driver: driver.Mock,
Driver: driver.Mock,
DockerEnv: []string{"FOO=BAR"},
DockerOpt: []string{"param=value"},
Downloader: MockDownloader{},
......
......@@ -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%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment