mirror of https://github.com/kubernetes/kops.git
Merge pull request #10799 from rifelpet/kubetest2-pod-logs
kubetest2 - Dump all pod logs in addition to host logs
This commit is contained in:
commit
7111ae164f
|
|
@ -46,6 +46,10 @@ func (d *deployer) DumpClusterLogs() error {
|
|||
return err
|
||||
}
|
||||
|
||||
if err := d.dumpClusterInfo(); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
|
|
@ -75,6 +79,23 @@ func (d *deployer) dumpClusterManifest() error {
|
|||
return nil
|
||||
}
|
||||
|
||||
func (d *deployer) dumpClusterInfo() error {
|
||||
args := []string{
|
||||
"kubectl", "cluster-info", "dump",
|
||||
"--all-namespaces",
|
||||
"-o", "yaml",
|
||||
"--output-directory", path.Join(d.ArtifactsDir, "cluster-info"),
|
||||
}
|
||||
klog.Info(strings.Join(args, " "))
|
||||
|
||||
cmd := exec.Command(args[0], args[1:]...)
|
||||
cmd.SetEnv(d.env()...)
|
||||
if err := cmd.Run(); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func runWithOutput(cmd exec.Cmd) error {
|
||||
exec.InheritOutput(cmd)
|
||||
return cmd.Run()
|
||||
|
|
|
|||
Loading…
Reference in New Issue