removed isClusterRunning check
parent
3e38a1954a
commit
a369264139
|
@ -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")
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue