Skip to content

Commit

Permalink
Controller: Set CNI args on the delegate request
Browse files Browse the repository at this point in the history
The CNI args has to be set in the delegate request so the cni-args in
the network attachment annotation are considered.

Signed-off-by: Lionel Jouin <[email protected]>
  • Loading branch information
LionelJouin committed Sep 7, 2023
1 parent 8e06025 commit c8ef869
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions pkg/controller/pod.go
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ func (pnc *PodNetworksController) processNextWorkItem() bool {
PodNetNS: netnsPath,
})
if err != nil {
klog.Errorf("error removing attachments: %v")
klog.Errorf("error removing attachments: %v", err)
return true
}
}
Expand Down Expand Up @@ -465,10 +465,11 @@ func rejectInterfaceAddEventFormat(pod *corev1.Pod) string {
}

func interfaceAttributes(networkData nadv1.NetworkSelectionElement) *multusapi.DelegateInterfaceAttributes {
if len(networkData.IPRequest) > 0 || networkData.MacRequest != "" {
if len(networkData.IPRequest) > 0 || networkData.MacRequest != "" || networkData.CNIArgs != nil {
return &multusapi.DelegateInterfaceAttributes{
IPRequest: networkData.IPRequest,
MacRequest: networkData.MacRequest,
CNIArgs: networkData.CNIArgs,
}
}
return nil
Expand Down

0 comments on commit c8ef869

Please sign in to comment.