Skip to content

feat: allow running operator in dry-run mode#2038

Merged
AndrewChubatiuk merged 4 commits intomasterfrom
dry-run-mode
Apr 8, 2026
Merged

feat: allow running operator in dry-run mode#2038
AndrewChubatiuk merged 4 commits intomasterfrom
dry-run-mode

Conversation

@vrutkovs
Copy link
Copy Markdown
Collaborator

@vrutkovs vrutkovs commented Apr 8, 2026

This would add --dry-run argument and DRY_RUN envvar, so that the operator would use a fake
client, logging calls instead of executing them. This is useful for operator upgrades in order to
ensure that the upgrade won't cause any mutating changes.

In addition to the new mode operator bin can be invoked separately instead of changing the operator deployment.

Fixes #1832

This would add `--dry-run` argument and `DRY_RUN` envvar, so that the operator would use a fake
client, logging calls instead of executing them. This is useful on operator upgrades in order to
ensure that the upgrade won't cause any mutating changes
Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2 issues found across 6 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:34">
P3: The issue link text says #1887, but the URL points to issue 1832. Update the URL or the label so the reference is correct.

(Based on your team's feedback about keeping docs links accurate.) [FEEDBACK_USED]</violation>

<violation number="2" location="docs/CHANGELOG.md:34">
P2: Custom agent: **Changelog Review Agent**

Changelog entry is missing the mandatory user-centric before/after/user-impact explanation required by the rule.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review, or fix all with cubic.

Comment thread docs/CHANGELOG.md Outdated
* FEATURE: [vmagent](https://docs.victoriametrics.com/operator/resources/vmagent/): support HPA in VMAgent CR and in VMAgent, which is a part of VMDistributed. See [#1961](https://github.com/VictoriaMetrics/operator/issues/1961).
* FEATURE: [vmagent](https://docs.victoriametrics.com/operator/resources/vmagent/): VMAgent CRs running in statefulSet mode, including VMAgent components in VMDistributed, now support configuring rolling update strategy behavior. See [#1987](https://github.com/VictoriaMetrics/operator/issues/1987).
* FEATURE: [vmagent](https://docs.victoriametrics.com/operator/resources/vmagent/): VMAgent CRs running in DaemonSet mode now support configuring rolling update strategy behavior.
* FEATURE: [vmoperator](https://docs.victoriametrics.com/operator/): Dry-run mode. See [#1887](https://github.com/VictoriaMetrics/operator/issues/1832).
Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot Apr 8, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: Custom agent: Changelog Review Agent

Changelog entry is missing the mandatory user-centric before/after/user-impact explanation required by the rule.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At docs/CHANGELOG.md, line 34:

<comment>Changelog entry is missing the mandatory user-centric before/after/user-impact explanation required by the rule.</comment>

<file context>
@@ -31,6 +31,7 @@ aliases:
 * FEATURE: [vmagent](https://docs.victoriametrics.com/operator/resources/vmagent/): support HPA in VMAgent CR and in VMAgent, which is a part of VMDistributed. See [#1961](https://github.com/VictoriaMetrics/operator/issues/1961).
 * FEATURE: [vmagent](https://docs.victoriametrics.com/operator/resources/vmagent/): VMAgent CRs running in statefulSet mode, including VMAgent components in VMDistributed, now support configuring rolling update strategy behavior.  See [#1987](https://github.com/VictoriaMetrics/operator/issues/1987).
 * FEATURE: [vmagent](https://docs.victoriametrics.com/operator/resources/vmagent/): VMAgent CRs running in DaemonSet mode now support configuring rolling update strategy behavior.
+* FEATURE: [vmoperator](https://docs.victoriametrics.com/operator/): Dry-run mode. See [#1887](https://github.com/VictoriaMetrics/operator/issues/1832).
 
 * BUGFIX: [vmoperator](https://docs.victoriametrics.com/operator/): VMPodScrape for VLAgent and VMAgent now uses the correct port; previously it used the wrong port and could cause scrape failures. See [#1887](https://github.com/VictoriaMetrics/operator/issues/1887).
</file context>
Fix with Cubic

Comment thread docs/CHANGELOG.md Outdated
@AndrewChubatiuk
Copy link
Copy Markdown
Contributor

i'm afraid with modification calls mocking operator will stick into loop in attempt to update with infinite logs. maybe reconciliation logic should be update as well to trigger it just once

@vrutkovs
Copy link
Copy Markdown
Collaborator Author

vrutkovs commented Apr 8, 2026

i'm afraid with modification calls mocking operator will stick into loop in attempt to update with infinite logs. maybe reconciliation logic should be update as well to trigger it just once

I think this is acceptable - we'll be showing that its persistent and basically just the first iteration matters. A CLI mode is more suitable for "one shot" type of output

Copy link
Copy Markdown
Contributor

@AndrewChubatiuk AndrewChubatiuk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! metrics with method, name and kind dimensions could be useful in a dry run mode

@vrutkovs
Copy link
Copy Markdown
Collaborator Author

vrutkovs commented Apr 8, 2026

oh, good point, reverted that (I was thinking that metrics are useless in oneshot mode, but they are useful in standard run mode)

@AndrewChubatiuk AndrewChubatiuk merged commit 8c23758 into master Apr 8, 2026
6 checks passed
@AndrewChubatiuk AndrewChubatiuk deleted the dry-run-mode branch April 8, 2026 17:18
vrutkovs added a commit that referenced this pull request Apr 8, 2026
* feat: allow running operator in dry-run mode

This would add `--dry-run` argument and `DRY_RUN` envvar, so that the operator would use a fake
client, logging calls instead of executing them. This is useful on operator upgrades in order to
ensure that the upgrade won't cause any mutating changes

* feat: add operator dry-run subcommand to reconcile existing objects

* chore: bump default version to 0.68.3

* docs: update flags
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Dry-run mode

2 participants