diff --git a/controllers/sriovnetworknodepolicy_controller.go b/controllers/sriovnetworknodepolicy_controller.go index 3dc3e5b43..ff0db2947 100644 --- a/controllers/sriovnetworknodepolicy_controller.go +++ b/controllers/sriovnetworknodepolicy_controller.go @@ -143,6 +143,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 @@ -151,10 +155,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.