Skip to content

Commit

Permalink
Render SriovNetworkNodeState before Device Plugin ConfigMap
Browse files Browse the repository at this point in the history
Device Plugin ConfigMap relies on SriovNetworkNodeState object, so
we need to render it earlier.

The issue is occured only if node stops to correspond to
configDaemonNodeSelector during SR-IOV configuration, so controller
will delete SriovNetworkNodeState and won't re-create it again once node
starts correspond to configDaemonNodeSelector again.
  • Loading branch information
e0ne authored and zeeke committed Oct 9, 2024
1 parent 0f06a3b commit d7de9ea
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions controllers/sriovnetworknodepolicy_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,10 @@ func (r *SriovNetworkNodePolicyReconciler) Reconcile(ctx context.Context, req ct

// Sort the policies with priority, higher priority ones is applied later
sort.Sort(sriovnetworkv1.ByPriority(policyList.Items))
// Sync SriovNetworkNodeState objects
if err = r.syncAllSriovNetworkNodeStates(ctx, defaultPolicy, policyList, nodeList); err != nil {
return reconcile.Result{}, err
}
// Sync Sriov device plugin ConfigMap object
if err = r.syncDevicePluginConfigMap(ctx, policyList, nodeList); err != nil {
return reconcile.Result{}, err
Expand All @@ -153,10 +157,6 @@ func (r *SriovNetworkNodePolicyReconciler) Reconcile(ctx context.Context, req ct
if err = r.syncPluginDaemonObjs(ctx, defaultPolicy, policyList); err != nil {
return reconcile.Result{}, err
}
// Sync SriovNetworkNodeState objects
if err = r.syncAllSriovNetworkNodeStates(ctx, defaultPolicy, policyList, nodeList); err != nil {
return reconcile.Result{}, err
}

// All was successful. Request that this be re-triggered after ResyncPeriod,
// so we can reconcile state again.
Expand Down

0 comments on commit d7de9ea

Please sign in to comment.