@@ -1571,11 +1571,7 @@ func (ct *ConnectivityTest) createTestConnDisruptClientDeploymentForNSTraffic(ct
15711571 var errs error
15721572 np := uint16 (svc .Spec .Ports [0 ].NodePort )
15731573 addrs := slices .Clone (n .node .Status .Addresses )
1574- hasNetworkPolicies , err := ct .hasNetworkPolicies (ctx )
1575- if err != nil {
1576- return fmt .Errorf ("failed to check if any netpol exists: %w" , err )
1577- }
1578- ct .ForEachIPFamily (hasNetworkPolicies , func (family features.IPFamily ) {
1574+ ct .ForEachIPFamily (func (family features.IPFamily ) {
15791575 for _ , addr := range addrs {
15801576 if features .GetIPFamily (addr .Address ) != family {
15811577 continue
@@ -1738,36 +1734,6 @@ func (ct *ConnectivityTest) GetConnDisruptEgressPolicyEntries(ctx context.Contex
17381734 return targetEntries , nil
17391735}
17401736
1741- func (ct * ConnectivityTest ) hasNetworkPolicies (ctx context.Context ) (bool , error ) {
1742- for _ , client := range ct .Clients () {
1743- cnps , err := client .ListCiliumNetworkPolicies (ctx , ct .params .TestNamespace , metav1.ListOptions {Limit : 1 })
1744- if err != nil {
1745- return false , err
1746- }
1747- if len (cnps .Items ) > 0 {
1748- return true , nil
1749- }
1750-
1751- ccnps , err := client .ListCiliumClusterwideNetworkPolicies (ctx , metav1.ListOptions {Limit : 1 })
1752- if err != nil {
1753- return false , err
1754- }
1755- if len (ccnps .Items ) > 0 {
1756- return true , nil
1757- }
1758-
1759- nps , err := client .ListNetworkPolicies (ctx , metav1.ListOptions {Limit : 1 })
1760- if err != nil {
1761- return false , err
1762- }
1763- if len (nps .Items ) > 0 {
1764- return true , nil
1765- }
1766- }
1767-
1768- return false , nil
1769- }
1770-
17711737func (ct * ConnectivityTest ) createClientPerfDeployment (ctx context.Context , name string , nodeName string , hostNetwork bool ) error {
17721738 ct .Logf ("✨ [%s] Deploying %s deployment..." , ct .clients .src .ClusterName (), name )
17731739 gracePeriod := int64 (1 )
0 commit comments