File tree Expand file tree Collapse file tree 1 file changed +12
-5
lines changed Expand file tree Collapse file tree 1 file changed +12
-5
lines changed Original file line number Diff line number Diff line change @@ -400,11 +400,10 @@ func (udng *UserDefinedNetworkGateway) GetNetworkRuleMetadata() string {
400400 return fmt .Sprintf ("%s-%d" , udng .GetNetworkName (), udng .GetNetworkID ())
401401}
402402
403- // DelNetwork will be responsible to remove all plumbings
404- // used by this UDN on the gateway side
403+ // DelNetwork will be responsible to remove all plumbings used by this UDN on
404+ // the gateway side. It's considered invalid to call this instance after
405+ // DelNetwork has returned succesfully.
405406func (udng * UserDefinedNetworkGateway ) DelNetwork () error {
406- close (udng .reconcile )
407-
408407 vrfDeviceName := util .GetNetworkVRFName (udng .NetInfo )
409408 // delete the iprules for this network
410409 if err := udng .ruleManager .DeleteWithMetadata (udng .GetNetworkRuleMetadata ()); err != nil {
@@ -425,7 +424,15 @@ func (udng *UserDefinedNetworkGateway) DelNetwork() error {
425424 return err
426425 }
427426 // delete the management port interface for this network
428- return udng .deleteUDNManagementPort ()
427+ err := udng .deleteUDNManagementPort ()
428+ if err != nil {
429+ return err
430+ }
431+
432+ // close channel only when succesful since we can be called multiple times
433+ // on failure
434+ close (udng .reconcile )
435+ return nil
429436}
430437
431438// addUDNManagementPort does the following:
You can’t perform that action at this time.
0 commit comments