@@ -1625,7 +1625,7 @@ func TestEgressLifecycle(t *testing.T) {
1625
1625
doneDummyEvent (t , c )
1626
1626
}
1627
1627
1628
- func TestBGPSecretUpdate (t * testing.T ) {
1628
+ func TestBGPPasswordUpdate (t * testing.T ) {
1629
1629
policy := generateBGPPolicy (bgpPolicyName1 ,
1630
1630
creationTimestamp ,
1631
1631
nodeLabels1 ,
@@ -1707,6 +1707,24 @@ func TestBGPSecretUpdate(t *testing.T) {
1707
1707
require .NoError (t , c .syncBGPPolicy (ctx ))
1708
1708
// Done with the dummy event.
1709
1709
doneDummyEvent (t , c )
1710
+
1711
+ // Delete the Secret.
1712
+ err = c .client .CoreV1 ().Secrets (namespaceKubeSystem ).Delete (context .TODO (), secret .Name , metav1.DeleteOptions {})
1713
+ require .NoError (t , err )
1714
+ // Wait for the dummy event triggered by Secret delete event, and mark it done.
1715
+ waitAndGetDummyEvent (t , c )
1716
+ updatedIPv4Peer1Config = ipv4Peer1Config
1717
+ updatedIPv4Peer2Config = ipv4Peer2Config
1718
+ updatedIPv4Peer3Config = ipv4Peer3Config
1719
+ updatedIPv4Peer1Config .Password = ""
1720
+ updatedIPv4Peer2Config .Password = ""
1721
+ updatedIPv4Peer3Config .Password = ""
1722
+ mockBGPServer .EXPECT ().UpdatePeer (gomock .Any (), updatedIPv4Peer1Config )
1723
+ mockBGPServer .EXPECT ().UpdatePeer (gomock .Any (), updatedIPv4Peer2Config )
1724
+ mockBGPServer .EXPECT ().UpdatePeer (gomock .Any (), updatedIPv4Peer3Config )
1725
+ require .NoError (t , c .syncBGPPolicy (ctx ))
1726
+ // Done with the dummy event.
1727
+ doneDummyEvent (t , c )
1710
1728
}
1711
1729
1712
1730
func TestSyncBGPPolicyFailures (t * testing.T ) {
0 commit comments