fix: update iptables binary paths to use /usr/sbin instead of /sbin
continuous-integration/drone/push Build is passing
continuous-integration/drone/push Build is passing
Standardize iptables paths across firewall scripts and Go code to ensure compatibility with systems where iptables is located in /usr/sbin. This affects both legacy and non-legacy iptables binaries.
This commit is contained in:
@@ -173,7 +173,7 @@ pid, _ := dockerClient.GetContainerPID(ctx, containerName)
|
||||
|
||||
// 2. Execute iptables inside container namespace via nsenter
|
||||
exec.Command("nsenter", "-t", fmt.Sprintf("%d", pid), "-n", "--",
|
||||
"/sbin/iptables-legacy", "-t", "nat", "-I", "PREROUTING", ...)
|
||||
"/usr/sbin/iptables-legacy", "-t", "nat", "-I", "PREROUTING", ...)
|
||||
```
|
||||
|
||||
- `-t <pid>` — target the container's PID
|
||||
|
||||
Reference in New Issue
Block a user