Make sure we stop the localkube binary before starting another instance.
This makes "minikube start" re-entrant.pull/115/head
parent
647124b7c7
commit
d8e12ef42b
|
@ -148,7 +148,7 @@ type MachineConfig struct {
|
|||
|
||||
// StartCluster starts a k8s cluster on the specified Host.
|
||||
func StartCluster(h sshAble) error {
|
||||
commands := []string{startCommand}
|
||||
commands := []string{stopCommand, startCommand}
|
||||
|
||||
for _, cmd := range commands {
|
||||
output, err := h.RunSSHCommand(cmd)
|
||||
|
|
|
@ -96,7 +96,7 @@ func TestStartCluster(t *testing.T) {
|
|||
t.Fatalf("Error starting cluster: %s", err)
|
||||
}
|
||||
|
||||
for _, cmd := range []string{startCommand} {
|
||||
for _, cmd := range []string{stopCommand, startCommand} {
|
||||
if _, ok := h.Commands[cmd]; !ok {
|
||||
t.Fatalf("Expected command not run: %s. Commands run: %s", cmd, h.Commands)
|
||||
}
|
||||
|
|
|
@ -20,3 +20,6 @@ var startCommand = `
|
|||
# Run with nohup so it stays up. Redirect logs to useful places.
|
||||
PATH=/usr/local/sbin:$PATH nohup sudo /usr/local/bin/localkube start --generate-certs=false > /var/log/localkube.out 2> /var/log/localkube.err < /dev/null &
|
||||
`
|
||||
|
||||
// Kill any running instances.
|
||||
var stopCommand = "killall localkube | true"
|
||||
|
|
Loading…
Reference in New Issue