From ee22b477957dcd8d219db5dda1acf2bc81a720e1 Mon Sep 17 00:00:00 2001 From: x7upLime Date: Sat, 18 Feb 2023 17:19:31 +0200 Subject: [PATCH] Apply suggestions from code review --- cmd/minikube/cmd/delete.go | 8 ++++---- test/integration/functional_test_mount_test.go | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/cmd/minikube/cmd/delete.go b/cmd/minikube/cmd/delete.go index a982c6f3ef..76af023303 100644 --- a/cmd/minikube/cmd/delete.go +++ b/cmd/minikube/cmd/delete.go @@ -585,7 +585,7 @@ func deleteMachineDirectories(cc *config.ClusterConfig) { } // killMountProcess looks for the legacy path and for profile path for a pidfile, -// it then tries to kill all the pids listed in the pidfile(one or more) +// it then tries to kill all the pids listed in the pidfile (one or more) func killMountProcess() error { profile := viper.GetString("profile") paths := []string{ @@ -602,7 +602,7 @@ func killMountProcess() error { return nil } -// killProcess takes a path to look for a pidfile(space-separated), +// killProcess takes a path to look for a pidfile (space-separated), // it reads the file and converts it to a bunch of pid ints, // then it tries to kill each one of them. // If no errors were ecnountered, it cleans the pidfile @@ -634,14 +634,14 @@ func killProcess(path string) error { } else if len(errs) != 0 { // if multiple errors were encountered, we're outputting them // and returning a new multiple-errors error: - out.Step(style.Failure, "Ecountered multiple errors:") + out.Styled(style.Failure, "Multiple errors encountered:") for _, e := range errs { out.Err("%v\n", e) } return errors.New("multiple errors encountered while closing mount processes") } - // if no errors were encoutered, it is safe to clean out the pidFile + // if no errors were encoutered, it's safe to delete pidFile if err := os.Remove(pidPath); err != nil { return errors.Wrap(err, "While closing mount-pids file") } diff --git a/test/integration/functional_test_mount_test.go b/test/integration/functional_test_mount_test.go index 454c9521fa..3cf80516a1 100644 --- a/test/integration/functional_test_mount_test.go +++ b/test/integration/functional_test_mount_test.go @@ -327,7 +327,7 @@ func validateMountCmd(ctx context.Context, t *testing.T, profile string) { // no // if something weird has happened from previous tests.. // this could at least spare us some waiting if strings.Contains(rr.Stdout.String(), fmt.Sprintf("Profile \"%s\" not found.", profile)) { - t.Fatalf("somehow the profile got cancelled; failing....") + t.Fatalf("profile was deleted, cancelling the test") } return err } @@ -346,7 +346,7 @@ func validateMountCmd(ctx context.Context, t *testing.T, profile string) { // no for _, mntp := range mntProcs { // Trying to wait for process end // if the wait fail with ExitError we know that the process - // doesnt' exist anymore.. + // doesn't exist anymore.. go func(end chan bool) { err := mntp.cmd.Wait() if _, ok := err.(*exec.ExitError); ok {