Skip to content

Commit

Permalink
Handle case where docker not installed
Browse files Browse the repository at this point in the history
Docker is not guaranteed to be installed on a github runner.
Previously, if docker was not installed,
the configure firewall step failed because
DOCKER-USER iptables chain did not exist.
Fix that by only updating the firewall rules
if the DOCKER-USER chain exists.

Fixes: #19
  • Loading branch information
samuelallan72 committed Aug 5, 2024
1 parent ce8decb commit 6f970bd
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,7 @@ runs:
shell: bash
run: |
set -x
sudo iptables -I DOCKER-USER -i lxdbr0 -j ACCEPT
sudo iptables -I DOCKER-USER -o lxdbr0 -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
if sudo iptables -L DOCKER-USER; then
sudo iptables -I DOCKER-USER -i lxdbr0 -j ACCEPT
sudo iptables -I DOCKER-USER -o lxdbr0 -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
fi

0 comments on commit 6f970bd

Please sign in to comment.