Bug 2171801

Summary: virt-operator performs redundant reconciliations to its operands
Product: Container Native Virtualization (CNV) Reporter: Igor Bezukh <ibezukh>
Component: VirtualizationAssignee: ffossemo
Status: ASSIGNED --- QA Contact: Kedar Bidarkar <kbidarka>
Severity: medium Docs Contact:
Priority: medium    
Version: 4.13.0CC: acardace
Target Milestone: ---   
Target Release: 4.14.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Igor Bezukh 2023-02-20 13:18:17 UTC
Description of problem:
There is a subset of configuration fields in Kubevirt CR which define controller behavior rather than deployment desired state. For example the migration configuration doesn't require any reconciliation of the virt-controller. The controller will read the updated bits upon its regular execution cycles.

Nevertheless, when changing such configuration, virt-operator performs reconciliation. The operator patches the virt-api, virt-controller, PDB and webhook resources with a new annotation each time. 

This is redundant, since the generation number should reflect the changes made to the resources, and not the internal runtime configuration.


Version-Release number of selected component (if applicable):


How reproducible:
100%

Steps to Reproduce:
1. Edit the Kubevirt CR. Update the following: 
   - spec.configration.migrations.parallelMigrationsPerCluster: 100
2. Observe the the virt-api deployment resource. kubevirt.io/generation will increase. Also metadata.generation will increase
3. Observe the Kubevirt CR status. The Last generation of the above-mentioned operands will increase.

Actual results:
Generation annotations of operands is being bumped

Expected results:
Generation annotation should be bumped only when desired state changed.


Additional info: