Merge pull request #10799 from rifelpet/kubetest2-pod-logs

kubetest2 - Dump all pod logs in addition to host logs
This commit is contained in:
Kubernetes Prow Robot 2021-02-11 20:52:47 -08:00 committed by GitHub
commit 7111ae164f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 21 additions and 0 deletions

View File

@ -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()