There is no way to update the PriorityClass (it's emutable). So in case of update, HCO delete and recreate it. I guess since it's modified in loops, there is some timing issue that causes HCO to fail to read the priority class in the next loop, and then it fails and miss the metric update. I'm not sure it worth to fix this issue. @stirabos - what do you think?
The proposed fix looks safe and robust.
I have added label to priority class --> kubevirt-cluster-critical, waited to 15+mins to reconcile. But it didn't happened. Also, count didn't get increased.
Tried on another cluster and worked as expected. Component: priorityclass/kubevirt-cluster-critical is reconciling and count is updating properly. Verifying BZ.
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory (Important: OpenShift Virtualization 4.11.0 Images security and bug fix update), and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHSA-2022:6526