File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -487,11 +487,15 @@ def _network_type(self) -> str:
487487
488488 @property
489489 def uses_secondary_ip (self ) -> bool :
490- # MNP_PRIMARY_DENY is a SECONDARY pod, but its traffic still flows on the primary IP
490+ # MNP_PRIMARY_DENY stays on primary; SR-IOV with a NAD uses secondary IP
491+ has_configured_secondary_network = bool (
492+ self ._get_node_secondary_network_nad ()
493+ or self .ts .connection .secondary_network_nad
494+ )
491495 return (
492496 self ._network_type == "secondary"
493497 and self .ts .connection_mode != ConnectionMode .MNP_PRIMARY_DENY
494- )
498+ ) or ( self . pod_type == PodType . SRIOV and has_configured_secondary_network )
495499
496500 def render_pod_file (self , log_info : str ) -> None :
497501 self .render_file (
@@ -621,10 +625,7 @@ def get_pod_ip(self) -> str:
621625 f"falling back to status.podIP"
622626 )
623627 pod_ip = y ["status" ]["podIP" ]
624- elif (
625- self ._get_node_secondary_network_nad ()
626- or self .ts .connection .secondary_network_nad
627- ):
628+ elif self .uses_secondary_ip :
628629 network_status_str = y ["metadata" ]["annotations" ][
629630 "k8s.v1.cni.cncf.io/network-status"
630631 ]
You can’t perform that action at this time.
0 commit comments