kubevirt / ssp-operator

Operator that deploys additional KubeVirt resources
Apache License 2.0
29 stars 47 forks source link

[release-v0.19] fix: Increase reconcile metric only if SSP CR was not changed #960

Closed akrejcir closed 5 months ago

akrejcir commented 5 months ago

Manual cherry-pick of: https://github.com/kubevirt/ssp-operator/pull/950 It was needed, because metrics code was refactored in main.

What this PR does / why we need it: The metric "kubevirt_ssp_common_templates_restored_total" should be increased if user changes a template and the operator restores it back to what it should be.

If the SSP CR is changed, for example one of the labels that are propagated to the templates are changed, then the reconciliation should not increase the metric.

Which issue(s) this PR fixes: Fixes: https://issues.redhat.com/browse/CNV-39928

Release note:

None
akrejcir commented 5 months ago

/cc @0xFelix @jcanocan

sonarcloud[bot] commented 5 months ago

Quality Gate Failed Quality Gate failed

Failed conditions
3 Security Hotspots
C Security Rating on New Code (required ≥ A)

See analysis details on SonarCloud

Catch issues before they fail your Quality Gate with our IDE extension SonarLint

jcanocan commented 5 months ago

/retest-required

kubevirt-bot commented 5 months ago

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: 0xFelix

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files: - ~~[OWNERS](https://github.com/kubevirt/ssp-operator/blob/release-v0.19/OWNERS)~~ [0xFelix] Approvers can indicate their approval by writing `/approve` in a comment Approvers can cancel approval by writing `/approve cancel` in a comment