Skip to content

Commit

Permalink
bgpv1: fix issue with pod cidr advertisement removal
Browse files Browse the repository at this point in the history
This change fixes diff code when there is multiple pod cidr withdrawals.

Signed-off-by: harsimran pabla <hpabla@isovalent.com>
  • Loading branch information
harsimran-pabla authored and ldelossa committed May 8, 2023
1 parent 3907a9a commit a0254cd
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
7 changes: 5 additions & 2 deletions pkg/bgpv1/manager/advertisements_reconciler.go
Expand Up @@ -102,8 +102,11 @@ func exportAdvertisementsReconciler(params *advertisementsReconcilerParams) ([]t
key := advrt.Net.String()
if m, ok = aset[key]; !ok {
aset[key] = &member{
b: true,
advrt: &advrt,
b: true,
advrt: &types.Advertisement{
Net: advrt.Net,
GoBGPPathUUID: advrt.GoBGPPathUUID,
},
}
continue
}
Expand Down
4 changes: 2 additions & 2 deletions pkg/bgpv1/manager/reconcile_test.go
Expand Up @@ -367,7 +367,7 @@ func TestExportPodCIDRReconciler(t *testing.T) {
updated: []string{"192.168.0.0/24", "192.168.1.0/24"},
},
{
name: "removal of network",
name: "removal of both networks",
enabled: true,
shouldEnable: true,
advertised: []*net.IPNet{
Expand All @@ -380,7 +380,7 @@ func TestExportPodCIDRReconciler(t *testing.T) {
Mask: net.IPv4Mask(255, 255, 255, 0),
},
},
updated: []string{"192.168.0.0/24"},
updated: []string{},
},
}

Expand Down

0 comments on commit a0254cd

Please sign in to comment.