@@ -1200,13 +1200,15 @@ func GetAdvertisedNetworkSubnetsDropACLdbIDs() *libovsdbops.DbObjectIDs {
12001200 return libovsdbops .NewDbObjectIDs (libovsdbops .ACLAdvertisedNetwork , advertisedNetworkIsolationACLID ,
12011201 map [libovsdbops.ExternalIDKey ]string {
12021202 libovsdbops .ObjectNameKey : advertisedNetworkSubnetsCtrl ,
1203+ libovsdbops .NetworkKey : "" ,
12031204 })
12041205}
12051206
1206- func GetAdvertisedNetworkSubnetsPassACLdbIDs (networkName string ) * libovsdbops.DbObjectIDs {
1207+ func GetAdvertisedNetworkSubnetsPassACLdbIDs (networkName string , networkID int ) * libovsdbops.DbObjectIDs {
12071208 return libovsdbops .NewDbObjectIDs (libovsdbops .ACLAdvertisedNetwork , advertisedNetworkIsolationACLID ,
12081209 map [libovsdbops.ExternalIDKey ]string {
12091210 libovsdbops .ObjectNameKey : networkName ,
1211+ libovsdbops .NetworkKey : strconv .Itoa (networkID ),
12101212 })
12111213}
12121214
@@ -1258,7 +1260,7 @@ func (bnc *BaseNetworkController) addAdvertisedNetworkIsolation(nodeName string)
12581260
12591261 if len (passMatches ) > 0 {
12601262 passACL := libovsdbutil .BuildACL (
1261- GetAdvertisedNetworkSubnetsPassACLdbIDs (bnc .GetNetworkName ()),
1263+ GetAdvertisedNetworkSubnetsPassACLdbIDs (bnc .GetNetworkName (), bnc . GetNetworkID () ),
12621264 types .AdvertisedNetworkPassPriority ,
12631265 strings .Join (passMatches , " || " ),
12641266 nbdb .ACLActionPass ,
@@ -1268,7 +1270,7 @@ func (bnc *BaseNetworkController) addAdvertisedNetworkIsolation(nodeName string)
12681270
12691271 ops , err = libovsdbops .CreateOrUpdateACLsOps (bnc .nbClient , ops , nil , passACL )
12701272 if err != nil {
1271- return fmt .Errorf ("failed to create or update network isolation pass ACL %s for network %s: %w" , GetAdvertisedNetworkSubnetsPassACLdbIDs (bnc .GetNetworkName ()), bnc .GetNetworkName (), err )
1273+ return fmt .Errorf ("failed to create or update network isolation pass ACL %s for network %s: %w" , GetAdvertisedNetworkSubnetsPassACLdbIDs (bnc .GetNetworkName (), bnc . GetNetworkID () ), bnc .GetNetworkName (), err )
12721274 }
12731275 ops , err = libovsdbops .AddACLsToLogicalSwitchOps (bnc .nbClient , ops , bnc .GetNetworkScopedSwitchName (nodeName ), passACL )
12741276 if err != nil {
@@ -1307,7 +1309,7 @@ func (bnc *BaseNetworkController) deleteAdvertisedNetworkIsolation(nodeName stri
13071309 return err
13081310 }
13091311
1310- passACLIDs := GetAdvertisedNetworkSubnetsPassACLdbIDs (bnc .GetNetworkName ())
1312+ passACLIDs := GetAdvertisedNetworkSubnetsPassACLdbIDs (bnc .GetNetworkName (), bnc . GetNetworkID () )
13111313 passACLPredicate := libovsdbops .GetPredicate [* nbdb.ACL ](passACLIDs , nil )
13121314 passACLs , err := libovsdbops .FindACLsWithPredicate (bnc .nbClient , passACLPredicate )
13131315 if err != nil {
0 commit comments