Skip to content

Commit

Permalink
Code review comments and added logs
Browse files Browse the repository at this point in the history
  • Loading branch information
Priya Wadhwa committed Dec 5, 2018
1 parent 765cc93 commit 095bfc6
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 7 deletions.
6 changes: 5 additions & 1 deletion cmd/minikube/cmd/config/validations.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,11 @@ func IsContainerdRuntime(_, _ string) error {
if config.KubernetesConfig.ContainerRuntime != constants.ContainerdRuntime {
return fmt.Errorf(`This addon can only be enabled with the containerd runtime backend.
To enable this backend, please start minikube again with the following flags:
To enable this backend, please first stop minikube with
minikube stop
and then start minikube again with the following flags:
minikube start --container-runtime=containerd --docker-opt containerd=/var/run/containerd/containerd.sock --network-plugin=cni`)
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/gvisor/disable.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ func Disable() error {
if err := os.Remove(filepath.Join(nodeDir, constants.ContainerdConfigTomlPath)); err != nil {
return errors.Wrapf(err, "removing %s", constants.ContainerdConfigTomlPath)
}
log.Printf("Storing default config.toml at %s", constants.ContainerdConfigTomlPath)
log.Printf("Restoring default config.toml at %s", constants.ContainerdConfigTomlPath)
if err := mcnutils.CopyFile(filepath.Join(nodeDir, constants.StoredContainerdConfigTomlPath), filepath.Join(nodeDir, constants.ContainerdConfigTomlPath)); err != nil {
return errors.Wrap(err, "reverting back to default config.toml")
}
Expand Down
7 changes: 5 additions & 2 deletions test/integration/addons_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import (
"bufio"
"fmt"
"io/ioutil"
"log"
"net"
"net/http"
"net/url"
Expand Down Expand Up @@ -191,11 +192,13 @@ func testGvisor(t *testing.T) {
t.Log("enabling gvisor addon")
minikubeRunner.RunCommand("addons enable gvisor", true)
t.Log("waiting for gvisor controller to come up")
if err := util.WaitForGvisorControllerRunning(); err != nil {
if err := util.WaitForGvisorControllerRunning(t); err != nil {
// Print out logs from controller
if _, err := kubectlRunner.RunCommand([]string{"get", "pods", "--all-namespaces"}); err != nil {
out, err := kubectlRunner.RunCommand([]string{"get", "pods", "--all-namespaces"})
if err != nil {
t.Errorf("error getting all pods %v", err)
}
log.Print(string(out))
if _, err := kubectlRunner.RunCommand([]string{"logs", "gvisor", "-n", "kube-system"}); err != nil {
t.Errorf("error getting gvisor logs: %v", err)
}
Expand Down
6 changes: 3 additions & 3 deletions test/integration/util/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ func (m *MinikubeRunner) Start() {
switch r := m.Runtime; r {
case constants.ContainerdRuntime:
// TODO: priyawadhwa@ remove iso url once updated iso is being used in integration tests
containerdFlags := "--container-runtime=containerd --network-plugin=cni --docker-opt containerd=/var/run/containerd/containerd.sock --iso-url=https://storage.googleapis.com/minikube-iso/minikube.iso"
containerdFlags := "--container-runtime=containerd --network-plugin=cni --docker-opt containerd=/var/run/containerd/containerd.sock --iso-url=https://storage.googleapis.com/gvisor-preview/minikube.iso"
m.RunCommand(fmt.Sprintf("start %s %s %s", m.StartArgs, m.Args, containerdFlags), true)
default:
m.RunCommand(fmt.Sprintf("start %s %s", m.StartArgs, m.Args), true)
Expand Down Expand Up @@ -300,7 +300,7 @@ func WaitForIngressDefaultBackendRunning(t *testing.T) error {
}

// WaitForGvisorControllerRunning waits for the gvisor controller pod to be running
func WaitForGvisorControllerRunning() error {
func WaitForGvisorControllerRunning(t *testing.T) error {
client, err := commonutil.GetClient()
if err != nil {
return errors.Wrap(err, "getting kubernetes client")
Expand Down Expand Up @@ -341,7 +341,7 @@ func WaitForUntrustedNginxRunning() error {
return nil
}

// WaitForFailedCreatePodSandBoxEvent waits for a FailedCreatePodSandBox event to show appear
// WaitForFailedCreatePodSandBoxEvent waits for a FailedCreatePodSandBox event to appear
func WaitForFailedCreatePodSandBoxEvent() error {
client, err := commonutil.GetClient()
if err != nil {
Expand Down

0 comments on commit 095bfc6

Please sign in to comment.