Skip to content

Commit

Permalink
made sure new flag is honored
Browse files Browse the repository at this point in the history
  • Loading branch information
hellt committed Feb 21, 2022
1 parent e6379b0 commit fd74f9f
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions runtime/docker/iptables.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ import (

// installIPTablesFwdRule calls iptables to install `allow` rule for traffic destined nodes on the clab management network
func (d *DockerRuntime) installIPTablesFwdRule() (err error) {
if !*d.mgmt.ExternalAccess {
return
}

if d.mgmt.Bridge == "" {
log.Debug("skipping setup of iptables forwarding rules for non-bridged management network")
return
Expand Down Expand Up @@ -42,6 +46,10 @@ func (d *DockerRuntime) installIPTablesFwdRule() (err error) {

// deleteIPTablesFwdRule deletes `allow` rule installed with InstallIPTablesFwdRule when the bridge interface doesn't exist anymore
func (d *DockerRuntime) deleteIPTablesFwdRule(br string) (err error) {
if !*d.mgmt.ExternalAccess {
return
}

if br == "" || br == "docker0" {
log.Debug("skipping deletion of iptables forwarding rule for non-bridged or default management network")
return
Expand Down

0 comments on commit fd74f9f

Please sign in to comment.