Merge pull request #15039 from justinsb/test_dump_iptables

tests: Capture iptables chains
This commit is contained in:
Kubernetes Prow Robot 2023-01-22 10:04:03 -08:00 committed by GitHub
commit 11dff6be3a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 0 deletions

View File

@ -292,6 +292,14 @@ func (n *logDumperNode) dump(ctx context.Context) []error {
} }
} }
// Capture iptables configuration
if err := n.shellToFile(ctx, "sudo iptables -t nat --list-rules", filepath.Join(n.dir, "iptables-nat.log")); err != nil {
errors = append(errors, err)
}
if err := n.shellToFile(ctx, "sudo iptables -t filter --list-rules", filepath.Join(n.dir, "iptables-filter.log")); err != nil {
errors = append(errors, err)
}
// Capture any file logs where the files exist // Capture any file logs where the files exist
fileList, err := n.findFiles(ctx, "/var/log") fileList, err := n.findFiles(ctx, "/var/log")
if err != nil { if err != nil {