1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

Tidy driver.go/LinkContainers

Docker-DCO-1.1-Signed-off-by: Ian Bishop <ianbishop@pace7.com> (github: porjo)
This commit is contained in:
Ian Bishop 2014-12-21 13:42:02 +10:00
parent 137ceae913
commit 38a595aec5

View file

@ -509,7 +509,6 @@ func LinkContainers(job *engine.Job) engine.Status {
parentIP = job.Getenv("ParentIP")
ignoreErrors = job.GetenvBool("IgnoreErrors")
ports = job.GetenvList("Ports")
chain = iptables.Chain{}
)
switch action {
@ -532,14 +531,11 @@ func LinkContainers(job *engine.Job) engine.Status {
return job.Errorf("child IP '%s' is invalid", childIP)
}
chain.Name = "DOCKER"
chain.Bridge = bridgeIface
chain := iptables.Chain{Name: "DOCKER", Bridge: bridgeIface}
for _, p := range ports {
port := nat.Port(p)
if err := chain.Link(nfAction, ip1, ip2, port.Int(), port.Proto()); !ignoreErrors && err != nil {
fmt.Print(err)
return job.Error(err)
}
}
return engine.StatusOK