Skip to content

Commit

Permalink
Merge pull request #5175 from rancher-sandbox/fix-wsl-function-xargs
Browse files Browse the repository at this point in the history
Remove xargs in factory reset iptables cleanup
  • Loading branch information
Nino-K authored Jul 17, 2023
2 parents f519d3b + 2836a84 commit 370d65b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion bats/tests/helpers/vm.bash
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,10 @@ factory_reset() {
run wsl sudo ip link delete nerdctl0

wsl sudo iptables -F
wsl sudo iptables -L | awk '/^Chain CNI/ {print $2}' | xargs -I{} wsl sudo iptables -X {}
local rule
wsl sudo iptables -L | awk '/^Chain CNI/ {print $2}' | while IFS= read -r rule; do
wsl sudo iptables -X "$rule"
done
fi
rdctl factory-reset
}
Expand Down

0 comments on commit 370d65b

Please sign in to comment.