Conversation
7b569bb to
a7fc951
Compare
840964f to
9e5ab0f
Compare
f41gh7
left a comment
There was a problem hiding this comment.
It's required to add documentation in first place. Is it possible that model could interfere on each other? Is it required to config VMAnomaly itself somehow? What is a relations between VMAnomaly and VMAnomalyModel?
Currently it's not possible to use this new API.
Also, I suggest to add -configCheckInterval to the vmanomaly in the same way as other components have it. It solves configuration reload without need of external config reloaders.
|
removed config reloader since python watchdog, which implements hot reload listens to fs events |
0ec9f87 to
1ba5e13
Compare
1ba5e13 to
4558e7c
Compare
|
added scheduler CR, added docs |
1b8eb91 to
2216f0a
Compare
2216f0a to
d0a06c0
Compare
66eac73 to
bfc5203
Compare
cdea53b to
5914c18
Compare
b08cb77 to
bf2eac2
Compare
bf2eac2 to
1b8d0ca
Compare
a757c9e to
30c4e13
Compare
30c4e13 to
96dc1df
Compare
96dc1df to
9d58b90
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 36 out of 36 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
9d58b90 to
11c333c
Compare
11c333c to
bf10354
Compare
c53d6a0 to
21aa85c
Compare
There was a problem hiding this comment.
8 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="internal/controller/operator/vmanomalyconfig_controller_test.go">
<violation number="1" location="internal/controller/operator/vmanomalyconfig_controller_test.go:47">
P2: Fail fast on non-NotFound errors in test setup instead of silently ignoring them.</violation>
</file>
<file name="docs/CHANGELOG.md">
<violation number="1" location="docs/CHANGELOG.md:34">
P1: Custom agent: **Changelog Review Agent**
This entry is missing the mandatory issue/PR reference link required by the changelog structure.</violation>
<violation number="2" location="docs/CHANGELOG.md:223">
P2: This changelog entry is duplicated and appears in the wrong release section (`v0.64.0` and `v0.65.0`), which makes release notes inaccurate.</violation>
<violation number="3" location="docs/CHANGELOG.md:223">
P1: Custom agent: **Changelog Review Agent**
New changelog entries must be added only to `tip`; this line adds a new BUGFIX entry in a released section, which violates placement requirements.</violation>
</file>
<file name="internal/controller/operator/vmanomalyconfig_controller.go">
<violation number="1" location="internal/controller/operator/vmanomalyconfig_controller.go:118">
P2: Propagate the CreateOrUpdateConfig error so reconcile fails and requeues instead of silently succeeding.</violation>
</file>
<file name="internal/controller/operator/factory/vmanomaly/config/config.go">
<violation number="1" location="internal/controller/operator/factory/vmanomaly/config/config.go:288">
P1: Writing merged model entries into `c.Models` can panic when the base config omits `models` (nil map). Initialize the map before assignment.</violation>
<violation number="2" location="internal/controller/operator/factory/vmanomaly/config/config.go:292">
P1: Writing merged scheduler entries into `c.Schedulers` can panic when the base config omits `schedulers` (nil map). Initialize the map before assignment.</violation>
</file>
<file name="internal/controller/operator/factory/vmanomaly/config/config_test.go">
<violation number="1" location="internal/controller/operator/factory/vmanomaly/config/config_test.go:714">
P2: The new external-config test sets `ConfigNamespaceSelector` but doesn't create a matching labeled Namespace object, so no `VMAnomalyConfig` can be selected in this setup.</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.
| * 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: [vmanomaly](https://docs.victoriametrics.com/operator/resources/vmanomaly/): introduce `VMAnomalyConfig` CRD to enable dynamic configuration and hot-reload support starting from VMAnomaly version `1.25.0`. |
There was a problem hiding this comment.
P1: Custom agent: Changelog Review Agent
This entry is missing the mandatory issue/PR reference link required by the changelog structure.
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>This entry is missing the mandatory issue/PR reference link required by the changelog structure.</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: [vmanomaly](https://docs.victoriametrics.com/operator/resources/vmanomaly/): introduce `VMAnomalyConfig` CRD to enable dynamic configuration and hot-reload support starting from VMAnomaly version `1.25.0`.
* 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>
| BeforeEach(func() { | ||
| By("creating the custom resource for the Kind VMAnomalyConfig") | ||
| err := k8sClient.Get(ctx, typeNamespacedName, vmanomalyconfig) | ||
| if err != nil && k8serrors.IsNotFound(err) { |
There was a problem hiding this comment.
P2: Fail fast on non-NotFound errors in test setup instead of silently ignoring them.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At internal/controller/operator/vmanomalyconfig_controller_test.go, line 47:
<comment>Fail fast on non-NotFound errors in test setup instead of silently ignoring them.</comment>
<file context>
@@ -0,0 +1,83 @@
+ BeforeEach(func() {
+ By("creating the custom resource for the Kind VMAnomalyConfig")
+ err := k8sClient.Get(ctx, typeNamespacedName, vmanomalyconfig)
+ if err != nil && k8serrors.IsNotFound(err) {
+ resource := &vmv1.VMAnomalyConfig{
+ ObjectMeta: metav1.ObjectMeta{
</file context>
docs/CHANGELOG.md
Outdated
| * BUGFIX: [vmoperator](https://docs.victoriametrics.com/operator/): fix an issue where the return value from a couple of controllers was always `nil`. See [#1532](https://github.com/VictoriaMetrics/operator/pull/1532) for details. | ||
| * BUGFIX: [VMCluster](https://docs.victoriametrics.com/operator/resources/vmcluster/): emit warning if `vmcluster.spec.vmselect.persistentVolume` is set, previously it was emitted for `vmcluster.spec.vmselect.storage`. | ||
| * BUGFIX: [vmoperator](https://docs.victoriametrics.com/operator/): Prevent endless Service reconcile loop by correctly track changes to Service.spec.LoadBalancerClass. See this issue [#1550](https://github.com/VictoriaMetrics/operator/issues/1550) for details. | ||
| * BUGFIX: [vmagent](https://docs.victoriametrics.com/operator/resources/vmagent/) and [vmanomaly](https://docs.victoriametrics.com/operator/resources/vmanomaly/): create PDB per shard to guarantee proper application protection. See [#1548](https://github.com/VictoriaMetrics/operator/issues/1548). |
There was a problem hiding this comment.
P2: This changelog entry is duplicated and appears in the wrong release section (v0.64.0 and v0.65.0), which makes release notes inaccurate.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At docs/CHANGELOG.md, line 223:
<comment>This changelog entry is duplicated and appears in the wrong release section (`v0.64.0` and `v0.65.0`), which makes release notes inaccurate.</comment>
<file context>
@@ -219,6 +220,7 @@ This change could be reverted by providing env variable `VM_USECUSTOMCONFIGRELOA
* BUGFIX: [vmoperator](https://docs.victoriametrics.com/operator/): fix an issue where the return value from a couple of controllers was always `nil`. See [#1532](https://github.com/VictoriaMetrics/operator/pull/1532) for details.
* BUGFIX: [VMCluster](https://docs.victoriametrics.com/operator/resources/vmcluster/): emit warning if `vmcluster.spec.vmselect.persistentVolume` is set, previously it was emitted for `vmcluster.spec.vmselect.storage`.
* BUGFIX: [vmoperator](https://docs.victoriametrics.com/operator/): Prevent endless Service reconcile loop by correctly track changes to Service.spec.LoadBalancerClass. See this issue [#1550](https://github.com/VictoriaMetrics/operator/issues/1550) for details.
+* BUGFIX: [vmagent](https://docs.victoriametrics.com/operator/resources/vmagent/) and [vmanomaly](https://docs.victoriametrics.com/operator/resources/vmanomaly/): create PDB per shard to guarantee proper application protection. See [#1548](https://github.com/VictoriaMetrics/operator/issues/1548).
</file context>
| } | ||
| } | ||
|
|
||
| if err := vmanomaly.CreateOrUpdateConfig(ctx, r, item, &instance); err != nil { |
There was a problem hiding this comment.
P2: Propagate the CreateOrUpdateConfig error so reconcile fails and requeues instead of silently succeeding.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At internal/controller/operator/vmanomalyconfig_controller.go, line 118:
<comment>Propagate the CreateOrUpdateConfig error so reconcile fails and requeues instead of silently succeeding.</comment>
<file context>
@@ -0,0 +1,136 @@
+ }
+ }
+
+ if err := vmanomaly.CreateOrUpdateConfig(ctx, r, item, &instance); err != nil {
+ l.Error(err, "failed to update vmanomaly config")
+ }
</file context>
starting 1.25.0 anomaly supports hot-reload, and this PR introduces VMAnomalyConfig CR, that allows to add extra
models,schedulersandqueriesfor VMAnomaly dynamic configuration