chore: clean up custom iptables chains on machine reset

This commit is contained in:
Pasha Sviderski
2025-07-25 12:37:54 +10:00
parent 3ab708a437
commit 614212a24c
2 changed files with 35 additions and 2 deletions
+3 -2
View File
@@ -408,8 +408,9 @@ func (cc *clusterController) Cleanup() error {
if err := cc.wgnet.Cleanup(); err != nil {
errs = append(errs, fmt.Errorf("cleanup WireGuard network: %w", err))
}
// TODO: cleanup custom iptables chains. They're flushed when the machine is initialised again but it would
// cleaner to delete them here.
if err := firewall.CleanupIptablesChains(); err != nil {
errs = append(errs, fmt.Errorf("cleanup iptables chains: %w", err))
}
return errors.Join(errs...)
}