@@ -638,12 +638,12 @@ func (ep *Endpoint) sbJoin(ctx context.Context, sb *Sandbox, options ...Endpoint
638638 // If ep has taken over as a gateway and there were gateways before, update them.
639639 if ep == gwepAfter4 || ep == gwepAfter6 {
640640 if gwepBefore4 != nil {
641- if err := gwepBefore4 .programExternalConnectivity (ctx , sb . Labels (), gwepAfter4 , gwepAfter6 ); err != nil {
641+ if err := gwepBefore4 .programExternalConnectivity (ctx , gwepAfter4 , gwepAfter6 ); err != nil {
642642 return fmt .Errorf ("updating external connectivity for IPv4 endpoint %s: %v" , epShortId (gwepBefore4 ), err )
643643 }
644644 defer func () {
645645 if retErr != nil {
646- if err := gwepBefore4 .programExternalConnectivity (ctx , sb . Labels (), gwepBefore4 , gwepBefore6 ); err != nil {
646+ if err := gwepBefore4 .programExternalConnectivity (ctx , gwepBefore4 , gwepBefore6 ); err != nil {
647647 log .G (ctx ).WithFields (log.Fields {
648648 "error" : err ,
649649 "restoreEp" : epShortId (gwepBefore4 ),
@@ -653,12 +653,12 @@ func (ep *Endpoint) sbJoin(ctx context.Context, sb *Sandbox, options ...Endpoint
653653 }()
654654 }
655655 if gwepBefore6 != nil {
656- if err := gwepBefore6 .programExternalConnectivity (ctx , sb . Labels (), gwepAfter4 , gwepAfter6 ); err != nil {
656+ if err := gwepBefore6 .programExternalConnectivity (ctx , gwepAfter4 , gwepAfter6 ); err != nil {
657657 return fmt .Errorf ("updating external connectivity for IPv6 endpoint %s: %v" , epShortId (gwepBefore6 ), err )
658658 }
659659 defer func () {
660660 if retErr != nil {
661- if err := gwepBefore6 .programExternalConnectivity (ctx , sb . Labels (), gwepBefore4 , gwepBefore6 ); err != nil {
661+ if err := gwepBefore6 .programExternalConnectivity (ctx , gwepBefore4 , gwepBefore6 ); err != nil {
662662 log .G (ctx ).WithFields (log.Fields {
663663 "error" : err ,
664664 "restoreEp" : epShortId (gwepBefore6 ),
@@ -669,8 +669,8 @@ func (ep *Endpoint) sbJoin(ctx context.Context, sb *Sandbox, options ...Endpoint
669669 }
670670 }
671671
672- // Tell the new endpoint its port mappings, and whether it's a gateway.
673- if err := ep .programExternalConnectivity (ctx , sb . Labels (), gwepAfter4 , gwepAfter6 ); err != nil {
672+ // Tell the new endpoint whether it's a gateway.
673+ if err := ep .programExternalConnectivity (ctx , gwepAfter4 , gwepAfter6 ); err != nil {
674674 return err
675675 }
676676
@@ -687,7 +687,7 @@ func (ep *Endpoint) sbJoin(ctx context.Context, sb *Sandbox, options ...Endpoint
687687 return nil
688688}
689689
690- func (ep * Endpoint ) programExternalConnectivity (ctx context.Context , sbLabels map [ string ] any , gwep4 , gwep6 * Endpoint ) error {
690+ func (ep * Endpoint ) programExternalConnectivity (ctx context.Context , gwep4 , gwep6 * Endpoint ) error {
691691 n , err := ep .getNetworkFromStore ()
692692 if err != nil {
693693 return types .InternalErrorf ("failed to get network from store for programming external connectivity: %v" , err )
@@ -703,7 +703,7 @@ func (ep *Endpoint) programExternalConnectivity(ctx context.Context, sbLabels ma
703703 "gw4" : epShortId (gwep4 ),
704704 "gw6" : epShortId (gwep6 ),
705705 }).Debug ("Programming external connectivity on endpoint" )
706- if err := ecd .ProgramExternalConnectivity (context .WithoutCancel (ctx ), n .ID (), ep .ID (), sbLabels , epId (gwep4 ), epId (gwep6 )); err != nil {
706+ if err := ecd .ProgramExternalConnectivity (context .WithoutCancel (ctx ), n .ID (), ep .ID (), epId (gwep4 ), epId (gwep6 )); err != nil {
707707 return types .InternalErrorf ("driver failed programming external connectivity on endpoint %s (%s): %v" ,
708708 ep .Name (), ep .ID (), err )
709709 }
@@ -820,7 +820,7 @@ func (ep *Endpoint) sbLeave(ctx context.Context, sb *Sandbox, force bool) error
820820
821821 if d != nil {
822822 if ecd , ok := d .(driverapi.ExtConner ); ok {
823- if err := ecd .ProgramExternalConnectivity (context .WithoutCancel (ctx ), n .ID (), ep .ID (), nil , "" , "" ); err != nil {
823+ if err := ecd .ProgramExternalConnectivity (context .WithoutCancel (ctx ), n .ID (), ep .ID (), "" , "" ); err != nil {
824824 log .G (ctx ).WithError (err ).Warn ("driver failed revoking external connectivity on endpoint" )
825825 }
826826 }
@@ -895,12 +895,12 @@ func (ep *Endpoint) sbLeave(ctx context.Context, sb *Sandbox, force bool) error
895895 // Find new endpoint(s) to provide external connectivity for the sandbox.
896896 gwepAfter4 , gwepAfter6 := sb .getGatewayEndpoint ()
897897 if gwepAfter4 != nil {
898- if err := gwepAfter4 .programExternalConnectivity (ctx , sb . Labels (), gwepAfter4 , gwepAfter6 ); err != nil {
898+ if err := gwepAfter4 .programExternalConnectivity (ctx , gwepAfter4 , gwepAfter6 ); err != nil {
899899 log .G (ctx ).WithError (err ).Error ("Failed to set IPv4 gateway" )
900900 }
901901 }
902902 if gwepAfter6 != nil && gwepAfter6 != gwepAfter4 {
903- if err := gwepAfter6 .programExternalConnectivity (ctx , sb . Labels (), gwepAfter4 , gwepAfter6 ); err != nil {
903+ if err := gwepAfter6 .programExternalConnectivity (ctx , gwepAfter4 , gwepAfter6 ); err != nil {
904904 log .G (ctx ).WithError (err ).Error ("Failed to set IPv6 gateway" )
905905 }
906906 }
0 commit comments