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 committed Aug 7, 2023
1 parent 99a78b7 commit 18a288a
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 @@ -132,6 +132,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 @@ -140,10 +144,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 18a288a

Please sign in to comment.