reconcile: delete finalizer during reconcile only for resources that do not have any cleanup tasks#1902
Conversation
There was a problem hiding this comment.
1 issue found across 21 files
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="docs/CHANGELOG.md">
<violation number="1" location="docs/CHANGELOG.md:23">
P1: Custom agent: **Changelog Review Agent**
This changelog entry violates the mandatory structure: it lacks required issue/PR references and describes internal implementation details instead of a clear user-visible before/after outcome.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
47418d4 to
ed152c7
Compare
ed152c7 to
299a15a
Compare
56916f3 to
8e418f6
Compare
5c56c1c to
a263dfc
Compare
| specD := diffDeep(actualPVC.Spec, newPVC.Spec) | ||
| logMsg := fmt.Sprintf("changes detected for PVC=%s metaDiff=%v, specDiff=%v", newPVC.Name, metaD, specD) | ||
| logger.WithContext(ctx).Info(logMsg) | ||
| specDiff := diffDeepDerivative(newObj.Spec, existingObj.Spec) |
There was a problem hiding this comment.
metadata is now updated in updatePVC function, before this function only changed PVC size.
a263dfc to
e486f15
Compare
|
@AndrewChubatiuk I have started the AI code review. It will take a few minutes to complete. |
There was a problem hiding this comment.
2 issues found across 31 files
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="docs/CHANGELOG.md">
<violation number="1" location="docs/CHANGELOG.md:27">
P1: Custom agent: **Changelog Review Agent**
This changelog entry doesn’t follow the required structure: it lacks a before/after user‑visible explanation and includes no issue/PR references. It also reads as an internal implementation detail, which is rejected by the changelog rule.</violation>
<violation number="2" location="docs/CHANGELOG.md:27">
P3: Rewrite this changelog entry for clarity and correct grammar so users can clearly understand which resources lose finalizers and which keep them.
(Based on your team's feedback about clarifying behavior and roles in documentation text.) [FEEDBACK_USED]</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
There was a problem hiding this comment.
1 issue found across 1 file (changes from recent commits).
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="docs/CHANGELOG.md">
<violation number="1" location="docs/CHANGELOG.md:27">
P1: Custom agent: **Changelog Review Agent**
This changelog entry violates the required structure because it omits issue/PR references (mandatory "References" section). Add relevant links to comply with the changelog format gate.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
| * BUGFIX: [vmdistributed](https://docs.victoriametrics.com/operator/resources/vmdistributed/): fix PVC being owned by StatefulSet and top-level object simultaenously. See [#1845](https://github.com/VictoriaMetrics/operator/issues/1845). | ||
|
|
||
| * BUGFIX: [vmoperator](https://docs.victoriametrics.com/operator/): remove unneeded finalizer from core K8s resources. See [#835](https://github.com/VictoriaMetrics/operator/issues/835). | ||
| * BUGFIX: [vmdistributed](https://docs.victoriametrics.com/operator/resources/vmdistributed/): remove finalizers from VMServiceScrape and VMPodScrape objects, and keep finalizers on VMAgent, VMCluster, and VMAuth when DeletionTimestamp is not empty. |
There was a problem hiding this comment.
P1: Custom agent: Changelog Review Agent
This changelog entry violates the required structure because it omits issue/PR references (mandatory "References" section). Add relevant links to comply with the changelog format gate.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At docs/CHANGELOG.md, line 27:
<comment>This changelog entry violates the required structure because it omits issue/PR references (mandatory "References" section). Add relevant links to comply with the changelog format gate.</comment>
<file context>
@@ -24,7 +24,7 @@ aliases:
* BUGFIX: [vmdistributed](https://docs.victoriametrics.com/operator/resources/vmdistributed/): fix PVC being owned by StatefulSet and top-level object simultaenously. See [#1845](https://github.com/VictoriaMetrics/operator/issues/1845).
* BUGFIX: [vmoperator](https://docs.victoriametrics.com/operator/): remove unneeded finalizer from core K8s resources. See [#835](https://github.com/VictoriaMetrics/operator/issues/835).
-* BUGFIX: [vmdistributed](https://docs.victoriametrics.com/operator/resources/vmdistributed/): remove finalizers from VMServiceScrape and VMPodScrape objects and keep them at VMAgent, VMCluster, VMAuth finalizers when DeletionTimestamp is not empty
+* BUGFIX: [vmdistributed](https://docs.victoriametrics.com/operator/resources/vmdistributed/): remove finalizers from VMServiceScrape and VMPodScrape objects, and keep finalizers on VMAgent, VMCluster, and VMAuth when DeletionTimestamp is not empty.
## [v0.68.1](https://github.com/VictoriaMetrics/operator/releases/tag/v0.68.1)
</file context>
…do not have any cleanup tasks
0a14bcc to
afdb35f
Compare
|
Perhaps this fixes #1921? I wonder if we could add test for that? |
- convert NamespacedName to string in logs - update diffDeepDerivative, now slices and maps and considered equal if length of both is 0 (not only of the first maps as it was before), before labels and annotations diff was ignored - do not take PVC metadata diff into account during checking if STS should be recreated since metadata update is covered by a separate function - fixed diffDeep and diffDeepDerivative signature, arguments were swapped before
afdb35f to
fe8a38a
Compare
…do not have any cleanup tasks (#1902) * reconcile: delete finalizer during reconcile only for resources that do not have any cleanup tasks * reconcile updates - convert NamespacedName to string in logs - update diffDeepDerivative, now slices and maps and considered equal if length of both is 0 (not only of the first maps as it was before), before labels and annotations diff was ignored - do not take PVC metadata diff into account during checking if STS should be recreated since metadata update is covered by a separate function - fixed diffDeep and diffDeepDerivative signature, arguments were swapped before
currently reconcile functions for VMAgent, VMAuth and VMCluster remove finalizer on non-empty DeletionTimestamp, which may lead to dangling resources. This PR keeps finalizer for these resources when DeletionTimestamp is not empty to let respective controller handle resource removal.
additionally:
Summary by cubic
Keep finalizers only on resources that need cleanup (VMAgent, VMAuth, VMCluster), and remove them during reconcile for core K8s and scrape resources to prevent stuck deletions. Diff is now directional (desired vs current) and treats empty and nil equally; StatefulSet recreate checks use Spec-only changes.
Bug Fixes
Refactors
Written for commit fe8a38a. Summary will update on new commits.