From a369264139750817a074ee560ec272cf59d0c273 Mon Sep 17 00:00:00 2001 From: Steven Powell Date: Mon, 15 Mar 2021 16:41:22 -0700 Subject: [PATCH] removed isClusterRunning check --- cmd/minikube/cmd/logs.go | 16 +--------------- pkg/minikube/logs/logs.go | 11 +---------- 2 files changed, 2 insertions(+), 25 deletions(-) diff --git a/cmd/minikube/cmd/logs.go b/cmd/minikube/cmd/logs.go index 386fa4ca77..9d102ad88e 100644 --- a/cmd/minikube/cmd/logs.go +++ b/cmd/minikube/cmd/logs.go @@ -23,7 +23,6 @@ import ( "github.com/spf13/viper" cmdcfg "k8s.io/minikube/cmd/minikube/cmd/config" "k8s.io/minikube/pkg/minikube/cluster" - "k8s.io/minikube/pkg/minikube/config" "k8s.io/minikube/pkg/minikube/cruntime" "k8s.io/minikube/pkg/minikube/exit" "k8s.io/minikube/pkg/minikube/logs" @@ -53,10 +52,7 @@ var logsCmd = &cobra.Command{ Short: "Returns logs to debug a local Kubernetes cluster", Long: `Gets the logs of the running instance, used for debugging minikube, not user code.`, Run: func(cmd *cobra.Command, args []string) { - if !isClusterRunning() { - logs.OutputOffline(numberOfLines) - return - } + logs.OutputOffline(numberOfLines) co := mustload.Running(ClusterFlagValue()) @@ -91,16 +87,6 @@ var logsCmd = &cobra.Command{ }, } -func isClusterRunning() bool { - if _, err := config.Load(ClusterFlagValue()); err != nil { - if config.IsNotExist(err) { - return false - } - exit.Error(reason.HostConfigLoad, "Error getting cluster config", err) - } - return true -} - func init() { logsCmd.Flags().BoolVarP(&followLogs, "follow", "f", false, "Show only the most recent journal entries, and continuously print new entries as they are appended to the journal.") logsCmd.Flags().BoolVar(&showProblems, "problems", false, "Show only log entries which point to known problems") diff --git a/pkg/minikube/logs/logs.go b/pkg/minikube/logs/logs.go index be452f1cec..70ecaa71cf 100644 --- a/pkg/minikube/logs/logs.go +++ b/pkg/minikube/logs/logs.go @@ -190,16 +190,6 @@ func Output(r cruntime.Manager, bs bootstrapper.Bootstrapper, cfg config.Cluster } } - if err := outputAudit(lines); err != nil { - klog.Errorf("failed to output audit logs: %v", err) - failed = append(failed, "audit") - } - - if err := outputLastStart(); err != nil { - klog.Errorf("failed to output last start logs: %v", err) - failed = append(failed, "last start") - } - if len(failed) > 0 { return fmt.Errorf("unable to fetch logs for: %s", strings.Join(failed, ", ")) } @@ -251,6 +241,7 @@ func OutputOffline(lines int) { if err := outputLastStart(); err != nil { klog.Errorf("failed to output last start logs: %v", err) } + out.Styled(style.Empty, "") } // logCommands returns a list of commands that would be run to receive the anticipated logs