Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More logs: exited containers, controller manager, double line count #5249

Merged
merged 1 commit into from
Sep 3, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cmd/minikube/cmd/logs.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,5 +97,5 @@ var logsCmd = &cobra.Command{
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")
logsCmd.Flags().IntVarP(&numberOfLines, "length", "n", 30, "Number of lines back to go within the log")
logsCmd.Flags().IntVarP(&numberOfLines, "length", "n", 60, "Number of lines back to go within the log")
}
8 changes: 6 additions & 2 deletions pkg/minikube/logs/logs.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ import (
// rootCauseRe is a regular expression that matches known failure root causes
var rootCauseRe = regexp.MustCompile(`^error: |eviction manager: pods.* evicted|unknown flag: --|forbidden.*no providers available|eviction manager:.*evicted|tls: bad certificate|kubelet.*no API client|kubelet.*No api server|STDIN.*127.0.0.1:8080`)

// ignoreRe is a regular expression that matches spurious errors to not surface
// ignoreCauseRe is a regular expression that matches spurious errors to not surface
var ignoreCauseRe = regexp.MustCompile("error: no objects passed to apply")

// importantPods are a list of pods to retrieve logs for, in addition to the bootstrapper logs.
Expand All @@ -48,6 +48,7 @@ var importantPods = []string{
"kube-addon-manager",
"kubernetes-dashboard",
"storage-provisioner",
"kube-controller-manager",
}

// lookbackwardsCount is how far back to look in a log for problems. This should be large enough to
Expand Down Expand Up @@ -161,7 +162,10 @@ func logCommands(r cruntime.Manager, bs bootstrapper.Bootstrapper, length int, f
glog.Warningf("No container was found matching %q", pod)
continue
}
cmds[pod] = r.ContainerLogCmd(ids[0], length, follow)
for _, i := range ids {
key := fmt.Sprintf("%s [%s]", pod, i)
cmds[key] = r.ContainerLogCmd(i, length, follow)
}
}
cmds[r.Name()] = r.SystemLogCmd(length)
// Works across container runtimes with good formatting
Expand Down