mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
commit
e621b9cd7a
8 changed files with 12 additions and 56 deletions
|
@ -412,11 +412,7 @@ func startTestDriver() error {
|
|||
return err
|
||||
}
|
||||
|
||||
if err := ioutil.WriteFile("/etc/docker/plugins/test.spec", []byte(server.URL), 0644); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
return ioutil.WriteFile("/etc/docker/plugins/test.spec", []byte(server.URL), 0644)
|
||||
}
|
||||
|
||||
func newDnetConnection(val string) (*dnetConnection, error) {
|
||||
|
|
|
@ -763,11 +763,7 @@ func (d *driver) createNetwork(config *networkConfiguration) error {
|
|||
|
||||
// Apply the prepared list of steps, and abort at the first error.
|
||||
bridgeSetup.queueStep(setupDeviceUp)
|
||||
if err = bridgeSetup.apply(); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
return bridgeSetup.apply()
|
||||
}
|
||||
|
||||
func (d *driver) DeleteNetwork(nid string) error {
|
||||
|
|
|
@ -169,11 +169,7 @@ func setupIPTablesInternal(bridgeIface string, addr net.Addr, icc, ipmasq, hairp
|
|||
}
|
||||
|
||||
// Set Accept on all non-intercontainer outgoing packets.
|
||||
if err := programChainRule(outRule, "ACCEPT NON_ICC OUTGOING", enable); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
return programChainRule(outRule, "ACCEPT NON_ICC OUTGOING", enable)
|
||||
}
|
||||
|
||||
func programChainRule(rule iptRule, ruleDescr string, insert bool) error {
|
||||
|
@ -304,10 +300,7 @@ func setupInternalNetworkRules(bridgeIface string, addr net.Addr, icc, insert bo
|
|||
return err
|
||||
}
|
||||
// Set Inter Container Communication.
|
||||
if err := setIcc(bridgeIface, icc, insert); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
return setIcc(bridgeIface, icc, insert)
|
||||
}
|
||||
|
||||
func clearEndpointConnections(nlh *netlink.Handle, ep *bridgeEndpoint) {
|
||||
|
|
|
@ -144,11 +144,7 @@ func (d *driver) deleteEndpointFromStore(e *endpoint) error {
|
|||
return fmt.Errorf("overlay local store not initialized, ep not deleted")
|
||||
}
|
||||
|
||||
if err := d.localStore.DeleteObjectAtomic(e); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
return d.localStore.DeleteObjectAtomic(e)
|
||||
}
|
||||
|
||||
func (d *driver) writeEndpointToStore(e *endpoint) error {
|
||||
|
@ -156,10 +152,7 @@ func (d *driver) writeEndpointToStore(e *endpoint) error {
|
|||
return fmt.Errorf("overlay local store not initialized, ep not added")
|
||||
}
|
||||
|
||||
if err := d.localStore.PutObjectAtomic(e); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
return d.localStore.PutObjectAtomic(e)
|
||||
}
|
||||
|
||||
func (ep *endpoint) DataScope() string {
|
||||
|
|
|
@ -134,11 +134,7 @@ func (d *driver) deleteEndpointFromStore(e *endpoint) error {
|
|||
return fmt.Errorf("overlay local store not initialized, ep not deleted")
|
||||
}
|
||||
|
||||
if err := d.localStore.DeleteObjectAtomic(e); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
return d.localStore.DeleteObjectAtomic(e)
|
||||
}
|
||||
|
||||
func (d *driver) writeEndpointToStore(e *endpoint) error {
|
||||
|
@ -146,10 +142,7 @@ func (d *driver) writeEndpointToStore(e *endpoint) error {
|
|||
return fmt.Errorf("overlay local store not initialized, ep not added")
|
||||
}
|
||||
|
||||
if err := d.localStore.PutObjectAtomic(e); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
return d.localStore.PutObjectAtomic(e)
|
||||
}
|
||||
|
||||
func (ep *endpoint) DataScope() string {
|
||||
|
|
|
@ -202,11 +202,7 @@ func (ep *endpoint) Info() EndpointInfo {
|
|||
return ep
|
||||
}
|
||||
|
||||
if epi := sb.getEndpoint(ep.ID()); epi != nil {
|
||||
return epi
|
||||
}
|
||||
|
||||
return nil
|
||||
return sb.getEndpoint(ep.ID())
|
||||
}
|
||||
|
||||
func (ep *endpoint) Iface() InterfaceInfo {
|
||||
|
|
|
@ -276,11 +276,7 @@ func (c *ChainInfo) Forward(action Action, ip net.IP, port int, proto, destAddr
|
|||
"--dport", strconv.Itoa(destPort),
|
||||
"-j", "MASQUERADE",
|
||||
}
|
||||
if err := ProgramRule(Nat, "POSTROUTING", action, args); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
return ProgramRule(Nat, "POSTROUTING", action, args)
|
||||
}
|
||||
|
||||
// Link adds reciprocal ACCEPT rule for two supplied IP addresses.
|
||||
|
@ -301,10 +297,7 @@ func (c *ChainInfo) Link(action Action, ip1, ip2 net.IP, port int, proto string,
|
|||
// reverse
|
||||
args[7], args[9] = args[9], args[7]
|
||||
args[10] = "--sport"
|
||||
if err := ProgramRule(Filter, c.Name, action, args); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
return ProgramRule(Filter, c.Name, action, args)
|
||||
}
|
||||
|
||||
// ProgramRule adds the rule specified by args only if the
|
||||
|
|
|
@ -67,11 +67,7 @@ func (sb *sandbox) setupResolutionFiles() error {
|
|||
return err
|
||||
}
|
||||
|
||||
if err := sb.setupDNS(); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
return sb.setupDNS()
|
||||
}
|
||||
|
||||
func (sb *sandbox) buildHostsFile() error {
|
||||
|
|
Loading…
Add table
Reference in a new issue