Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions cmd/drone-docker/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,11 @@ func main() {
Usage: "docker daemon executes in debug mode",
EnvVar: "PLUGIN_DEBUG,DOCKER_LAUNCH_DEBUG",
},
cli.BoolTFlag{
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should be Bool instead of BoolT. The BoolT parameter defaults to true if unset, however, in this case I think we want to disable to false and only disable IP tables if the user explicitly sets this value to true

Name: "daemon.iptables",
Usage: "docker daemon enable addition of iptables rules",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also consider changing the description to make it clear that this flag disables iptable rules, instead of enabling

EnvVar: "PLUGIN_IPTABLES_OFF",
},
cli.BoolFlag{
Name: "daemon.off",
Usage: "don't start the docker daemon",
Expand Down Expand Up @@ -285,6 +290,7 @@ func run(c *cli.Context) error {
Disabled: c.Bool("daemon.off"),
IPv6: c.Bool("daemon.ipv6"),
Debug: c.Bool("daemon.debug"),
IPTablesOff: c.Bool("daemon.iptables"),
Bip: c.String("daemon.bip"),
DNS: c.StringSlice("daemon.dns"),
DNSSearch: c.StringSlice("daemon.dns-search"),
Expand Down
4 changes: 4 additions & 0 deletions docker.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ type (
StoragePath string // Docker daemon storage path
Disabled bool // DOcker daemon is disabled (already running)
Debug bool // Docker daemon started in debug mode
IPTablesOff bool // docker daemon enable/disable addition of iptables rules
Bip string // Docker daemon network bridge IP address
DNS []string // Docker daemon dns server
DNSSearch []string // Docker daemon dns search domain
Expand Down Expand Up @@ -370,6 +371,9 @@ func commandDaemon(daemon Daemon) *exec.Cmd {
if daemon.Experimental {
args = append(args, "--experimental")
}
if daemon.IPTablesOff {
args = append(args, "--iptables=false")
}
return exec.Command(dockerdExe, args...)
}

Expand Down