Merge pull request #7484 from medyagh/post_mortem_logs
make post mortem logs easier on the eyepull/7489/head
commit
6ba0e15e84
|
@ -201,34 +201,39 @@ func clusterLogs(t *testing.T, profile string) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
t.Logf("-----------------------post-mortem--------------------------------")
|
||||||
t.Logf("<<< %s FAILED: start of post-mortem logs <<<", t.Name())
|
t.Logf("<<< %s FAILED: start of post-mortem logs <<<", t.Name())
|
||||||
|
t.Logf("-------------------post-mortem minikube logs----------------------")
|
||||||
rr, err := Run(t, exec.Command(Target(), "-p", profile, "logs", "--problems"))
|
rr, err := Run(t, exec.Command(Target(), "-p", profile, "logs", "--problems"))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Logf("failed logs error: %v", err)
|
t.Logf("failed logs error: %v", err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
t.Logf("%s logs: %s", t.Name(), rr.Stdout)
|
t.Logf("%s logs: %s", t.Name(), rr.Output())
|
||||||
|
|
||||||
|
t.Logf("------------------post-mortem api server status-------------------")
|
||||||
st = Status(context.Background(), t, Target(), profile, "APIServer")
|
st = Status(context.Background(), t, Target(), profile, "APIServer")
|
||||||
if st != state.Running.String() {
|
if st != state.Running.String() {
|
||||||
t.Logf("%q apiserver is not running, skipping kubectl commands (state=%q)", profile, st)
|
t.Logf("%q apiserver is not running, skipping kubectl commands (state=%q)", profile, st)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
t.Logf("--------------------post-mortem get pods--------------------------")
|
||||||
rr, rerr := Run(t, exec.Command("kubectl", "--context", profile, "get", "po", "-A", "--show-labels"))
|
rr, rerr := Run(t, exec.Command("kubectl", "--context", profile, "get", "po", "-A", "--show-labels"))
|
||||||
if rerr != nil {
|
if rerr != nil {
|
||||||
t.Logf("%s: %v", rr.Command(), rerr)
|
t.Logf("%s: %v", rr.Command(), rerr)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
t.Logf("(dbg) %s:\n%s", rr.Command(), rr.Stdout)
|
t.Logf("(dbg) %s:\n%s", rr.Command(), rr.Output())
|
||||||
|
t.Logf("-------------------post-mortem describe node----------------------")
|
||||||
rr, err = Run(t, exec.Command("kubectl", "--context", profile, "describe", "node"))
|
rr, err = Run(t, exec.Command("kubectl", "--context", profile, "describe", "node"))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Logf("%s: %v", rr.Command(), err)
|
t.Logf("%s: %v", rr.Command(), err)
|
||||||
} else {
|
} else {
|
||||||
t.Logf("(dbg) %s:\n%s", rr.Command(), rr.Stdout)
|
t.Logf("(dbg) %s:\n%s", rr.Command(), rr.Output())
|
||||||
}
|
}
|
||||||
|
t.Logf("------------------------------------------------------------------")
|
||||||
t.Logf("<<< %s FAILED: end of post-mortem logs <<<", t.Name())
|
t.Logf("<<< %s FAILED: end of post-mortem logs <<<", t.Name())
|
||||||
|
t.Logf("---------------------/post-mortem---------------------------------")
|
||||||
}
|
}
|
||||||
|
|
||||||
// podStatusMsg returns a human-readable pod status, for generating debug status
|
// podStatusMsg returns a human-readable pod status, for generating debug status
|
||||||
|
|
Loading…
Reference in New Issue