Propagate error from INC rule setup

Signed-off-by: Rob Murray <rob.murray@docker.com>
This commit is contained in:
Rob Murray
2024-09-19 19:39:51 +01:00
parent d3b7d84b23
commit 255fff4acd

View File

@@ -847,10 +847,10 @@ func (d *driver) createNetwork(config *networkConfiguration) (err error) {
// Add inter-network communication rules. // Add inter-network communication rules.
setupNetworkIsolationRules := func(config *networkConfiguration, i *bridgeInterface) error { setupNetworkIsolationRules := func(config *networkConfiguration, i *bridgeInterface) error {
if err := network.isolateNetwork(true); err != nil { if err := network.isolateNetwork(true); err != nil {
if err = network.isolateNetwork(false); err != nil { if errRollback := network.isolateNetwork(false); errRollback != nil {
log.G(context.TODO()).Warnf("Failed on removing the inter-network iptables rules on cleanup: %v", err) log.G(context.TODO()).WithError(errRollback).Warnf("Failed on removing the inter-network iptables rules on cleanup")
} }
return err return errdefs.System(err)
} }
// register the cleanup function // register the cleanup function
network.registerIptCleanFunc(func() error { network.registerIptCleanFunc(func() error {