Skip to content

Commit

Permalink
Render SriovNetworkNodeState before Device Plugin ConfigMap
Browse files Browse the repository at this point in the history
  • Loading branch information
wangyd1988 committed Dec 5, 2023
1 parent 94a376b commit 3d29255
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions controllers/sriovnetworknodepolicy_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,11 @@ 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(defaultPolicy, policyList, nodeList); err != nil {
return reconcile.Result{}, err
}

if os.Getenv("SRIOV_DEVICE_PLUGIN_IMAGE") != "" {
// Sync Sriov device plugin ConfigMap object
if err = r.syncDevicePluginConfigMap(policyList, nodeList); err != nil {
Expand All @@ -154,10 +159,7 @@ func (r *SriovNetworkNodePolicyReconciler) Reconcile(ctx context.Context, req ct
return reconcile.Result{}, err
}
}
// Sync SriovNetworkNodeState objects
if err = r.syncAllSriovNetworkNodeStates(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 3d29255

Please sign in to comment.