Skip to content

Commit 095bfc6

Browse files
author
Priya Wadhwa
committed
Code review comments and added logs
1 parent 765cc93 commit 095bfc6

File tree

4 files changed

+14
-7
lines changed

4 files changed

+14
-7
lines changed

Diff for: cmd/minikube/cmd/config/validations.go

+5-1
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,11 @@ func IsContainerdRuntime(_, _ string) error {
136136
if config.KubernetesConfig.ContainerRuntime != constants.ContainerdRuntime {
137137
return fmt.Errorf(`This addon can only be enabled with the containerd runtime backend.
138138
139-
To enable this backend, please start minikube again with the following flags:
139+
To enable this backend, please first stop minikube with
140+
141+
minikube stop
142+
143+
and then start minikube again with the following flags:
140144
141145
minikube start --container-runtime=containerd --docker-opt containerd=/var/run/containerd/containerd.sock --network-plugin=cni`)
142146
}

Diff for: pkg/gvisor/disable.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ func Disable() error {
3232
if err := os.Remove(filepath.Join(nodeDir, constants.ContainerdConfigTomlPath)); err != nil {
3333
return errors.Wrapf(err, "removing %s", constants.ContainerdConfigTomlPath)
3434
}
35-
log.Printf("Storing default config.toml at %s", constants.ContainerdConfigTomlPath)
35+
log.Printf("Restoring default config.toml at %s", constants.ContainerdConfigTomlPath)
3636
if err := mcnutils.CopyFile(filepath.Join(nodeDir, constants.StoredContainerdConfigTomlPath), filepath.Join(nodeDir, constants.ContainerdConfigTomlPath)); err != nil {
3737
return errors.Wrap(err, "reverting back to default config.toml")
3838
}

Diff for: test/integration/addons_test.go

+5-2
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ import (
2222
"bufio"
2323
"fmt"
2424
"io/ioutil"
25+
"log"
2526
"net"
2627
"net/http"
2728
"net/url"
@@ -191,11 +192,13 @@ func testGvisor(t *testing.T) {
191192
t.Log("enabling gvisor addon")
192193
minikubeRunner.RunCommand("addons enable gvisor", true)
193194
t.Log("waiting for gvisor controller to come up")
194-
if err := util.WaitForGvisorControllerRunning(); err != nil {
195+
if err := util.WaitForGvisorControllerRunning(t); err != nil {
195196
// Print out logs from controller
196-
if _, err := kubectlRunner.RunCommand([]string{"get", "pods", "--all-namespaces"}); err != nil {
197+
out, err := kubectlRunner.RunCommand([]string{"get", "pods", "--all-namespaces"})
198+
if err != nil {
197199
t.Errorf("error getting all pods %v", err)
198200
}
201+
log.Print(string(out))
199202
if _, err := kubectlRunner.RunCommand([]string{"logs", "gvisor", "-n", "kube-system"}); err != nil {
200203
t.Errorf("error getting gvisor logs: %v", err)
201204
}

Diff for: test/integration/util/util.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ func (m *MinikubeRunner) Start() {
127127
switch r := m.Runtime; r {
128128
case constants.ContainerdRuntime:
129129
// TODO: priyawadhwa@ remove iso url once updated iso is being used in integration tests
130-
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"
130+
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"
131131
m.RunCommand(fmt.Sprintf("start %s %s %s", m.StartArgs, m.Args, containerdFlags), true)
132132
default:
133133
m.RunCommand(fmt.Sprintf("start %s %s", m.StartArgs, m.Args), true)
@@ -300,7 +300,7 @@ func WaitForIngressDefaultBackendRunning(t *testing.T) error {
300300
}
301301

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

344-
// WaitForFailedCreatePodSandBoxEvent waits for a FailedCreatePodSandBox event to show appear
344+
// WaitForFailedCreatePodSandBoxEvent waits for a FailedCreatePodSandBox event to appear
345345
func WaitForFailedCreatePodSandBoxEvent() error {
346346
client, err := commonutil.GetClient()
347347
if err != nil {

0 commit comments

Comments
 (0)