Skip to content

feat: Install telemetry CRDs via crd-installer - #312

Open
jthakkar04 wants to merge 3 commits into
mainfrom
jthakkar/install-telemetry-crds
Open

feat: Install telemetry CRDs via crd-installer#312
jthakkar04 wants to merge 3 commits into
mainfrom
jthakkar/install-telemetry-crds

Conversation

@jthakkar04

@jthakkar04 jthakkar04 commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

In this PR we enabled installing the telemetry CRDs (VictoriaMetrics + Grafana) across helm upgrades by routing them through the existing crd-installer Job — which server-side-applies embedded CRDs on both install and upgrade — instead of shipping them inside the mode-gated operator subcharts. They now install in every telemetry mode, so switching off → forward/full becomes a clean controller/CR toggle.

We chose this because Helm never installs CRDs on upgrade (only on a fresh install), so a cluster first installed with telemetry off could never be upgraded to full. Reusing the crd-installer — the same mechanism already used for redis/clickhouse — keeps CRD lifecycle consistent and decoupled from the feature toggle.

Testing

Tilt up with off:

Screenshot 2026-08-03 at 12 59 29 PM

tilt trigger wandb-operator

Screenshot 2026-08-03 at 1 32 54 PM

🤖 Generated with Claude Code

Summary by CodeRabbit

Summary by CodeRabbit

  • New Features
    • Added operator-managed support for Grafana and VictoriaMetrics resources.
    • Added comprehensive resource definitions for dashboards, alerting, monitoring, logging, tracing, and service configuration.
    • Telemetry resources are now consistently available across telemetry configurations.
  • Bug Fixes
    • Improved upgrade safety through operator-managed CRD installation.
  • Documentation
    • Added guidance for maintaining and regenerating bundled resource definitions.

@jthakkar04
jthakkar04 requested a review from a team as a code owner August 3, 2026 17:48
@coderabbitai

coderabbitai Bot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

The change vendors VictoriaMetrics and Grafana CRDs, embeds them in the operator, and installs them through the upgrade-safe CRD installer. Helm CRD installation is disabled for these operators. Tests cover rendering, parsing, composition, and annotations.

Changes

Telemetry CRD installation

Layer / File(s) Summary
Vendor telemetry CRD manifests
pkg/vendored/grafana-operator/crds/*, pkg/vendored/victoria-metrics-operator/crds/*
Adds Grafana Operator and VictoriaMetrics Operator CRD manifests with schemas, validation, status fields, and vendoring documentation.
Embedded installer manifests
internal/crdinstaller/crds/grafana/*, internal/crdinstaller/crds/victoriametrics/*
Adds the CRDs used by the internal installer.
Installer wiring and deployment configuration
internal/crdinstaller/embed.go, deploy/operator/..., Tiltfile, Makefile
Registers telemetry groups, disables Helm-managed telemetry CRDs, and updates generation and synchronization targets.
Installer validation
internal/crdinstaller/compose_test.go, internal/controller/reconciler/telemetry_chart_test.go
Tests telemetry group parsing, CRD composition, Helm rendering, and certificate annotation behavior.

Estimated code review effort: 4 (Complex) | ~60 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Makefile
  participant VendoredCRDs
  participant EmbeddedCRDs
  participant CRDInstaller
  participant HelmChart
  Makefile->>VendoredCRDs: Extract and synchronize CRD manifests
  VendoredCRDs->>EmbeddedCRDs: Copy Grafana and VictoriaMetrics CRDs
  HelmChart->>CRDInstaller: Render telemetry CRD groups
  EmbeddedCRDs->>CRDInstaller: Provide embedded CRD filesystems
  CRDInstaller->>CRDInstaller: Compose telemetry CRDs without operator annotations
Loading

Possibly related PRs

  • wandb/operator#187: Extends the CRD installer and embedded CRD handling introduced by this PR.

Suggested reviewers: casey-coreweave

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 20.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: installing telemetry CRDs through the existing crd-installer Job.
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch jthakkar/install-telemetry-crds

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (2)
pkg/vendored/grafana-operator/crds/README.md (1)

30-33: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Add the upstream license file next to the vendored manifests. The README states the manifests retain the upstream Apache 2.0 license, but the directory contains no license copy. Add the upstream LICENSE file to this directory so the attribution is self-contained.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@pkg/vendored/grafana-operator/crds/README.md` around lines 30 - 33, Add the
upstream Apache 2.0 LICENSE file alongside the vendored manifests in the
directory described by the README, preserving its original license text and
attribution so the stated licensing is self-contained.
internal/controller/reconciler/telemetry_chart_test.go (1)

148-148: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Consider asserting each group independently.

The assertion matches the full flag string, so it also depends on redis and clickhouse being enabled by default and on the exact group order. A future default change to an unrelated subchart then breaks this test for a reason outside its intent. Assert that the rendered --groups= flag contains victoriametrics and grafana, so the test stays focused on telemetry.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@internal/controller/reconciler/telemetry_chart_test.go` at line 148, Update
the assertion around the rendered --groups= flag in the telemetry chart test to
verify victoriametrics and grafana independently, rather than matching the
complete group list and its order. Keep the test focused on telemetry groups
without asserting unrelated default groups such as redis or clickhouse.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@pkg/vendored/grafana-operator/crds/README.md`:
- Around line 8-11: Update the grafana-operator source documentation in the
README and the pinned chart reference in deploy/operator/Chart.yaml to use the
official OCI registry source, or explicitly document why this tree intentionally
uses the HTTP Helm repository and why it differs from upstream’s OCI
distribution.

---

Nitpick comments:
In `@internal/controller/reconciler/telemetry_chart_test.go`:
- Line 148: Update the assertion around the rendered --groups= flag in the
telemetry chart test to verify victoriametrics and grafana independently, rather
than matching the complete group list and its order. Keep the test focused on
telemetry groups without asserting unrelated default groups such as redis or
clickhouse.

In `@pkg/vendored/grafana-operator/crds/README.md`:
- Around line 30-33: Add the upstream Apache 2.0 LICENSE file alongside the
vendored manifests in the directory described by the README, preserving its
original license text and attribution so the stated licensing is self-contained.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 759270e0-e19f-452a-9cad-6286d52cb700

📥 Commits

Reviewing files that changed from the base of the PR and between db6e8d9 and 28228f1.

📒 Files selected for processing (35)
  • Makefile
  • Tiltfile
  • deploy/operator/templates/_helpers.tpl
  • deploy/operator/values.yaml
  • internal/controller/reconciler/telemetry_chart_test.go
  • internal/crdinstaller/compose_test.go
  • internal/crdinstaller/crds/grafana/grafana.integreatly.org_grafanaalertrulegroups.yaml
  • internal/crdinstaller/crds/grafana/grafana.integreatly.org_grafanacontactpoints.yaml
  • internal/crdinstaller/crds/grafana/grafana.integreatly.org_grafanadashboards.yaml
  • internal/crdinstaller/crds/grafana/grafana.integreatly.org_grafanadatasources.yaml
  • internal/crdinstaller/crds/grafana/grafana.integreatly.org_grafanafolders.yaml
  • internal/crdinstaller/crds/grafana/grafana.integreatly.org_grafanalibrarypanels.yaml
  • internal/crdinstaller/crds/grafana/grafana.integreatly.org_grafanamutetimings.yaml
  • internal/crdinstaller/crds/grafana/grafana.integreatly.org_grafananotificationpolicies.yaml
  • internal/crdinstaller/crds/grafana/grafana.integreatly.org_grafananotificationpolicyroutes.yaml
  • internal/crdinstaller/crds/grafana/grafana.integreatly.org_grafananotificationtemplates.yaml
  • internal/crdinstaller/crds/grafana/grafana.integreatly.org_grafanas.yaml
  • internal/crdinstaller/crds/grafana/grafana.integreatly.org_grafanaserviceaccounts.yaml
  • internal/crdinstaller/crds/victoriametrics/vm_crds.yaml
  • internal/crdinstaller/embed.go
  • pkg/vendored/grafana-operator/crds/README.md
  • pkg/vendored/grafana-operator/crds/grafana.integreatly.org_grafanaalertrulegroups.yaml
  • pkg/vendored/grafana-operator/crds/grafana.integreatly.org_grafanacontactpoints.yaml
  • pkg/vendored/grafana-operator/crds/grafana.integreatly.org_grafanadashboards.yaml
  • pkg/vendored/grafana-operator/crds/grafana.integreatly.org_grafanadatasources.yaml
  • pkg/vendored/grafana-operator/crds/grafana.integreatly.org_grafanafolders.yaml
  • pkg/vendored/grafana-operator/crds/grafana.integreatly.org_grafanalibrarypanels.yaml
  • pkg/vendored/grafana-operator/crds/grafana.integreatly.org_grafanamutetimings.yaml
  • pkg/vendored/grafana-operator/crds/grafana.integreatly.org_grafananotificationpolicies.yaml
  • pkg/vendored/grafana-operator/crds/grafana.integreatly.org_grafananotificationpolicyroutes.yaml
  • pkg/vendored/grafana-operator/crds/grafana.integreatly.org_grafananotificationtemplates.yaml
  • pkg/vendored/grafana-operator/crds/grafana.integreatly.org_grafanas.yaml
  • pkg/vendored/grafana-operator/crds/grafana.integreatly.org_grafanaserviceaccounts.yaml
  • pkg/vendored/victoria-metrics-operator/crds/README.md
  • pkg/vendored/victoria-metrics-operator/crds/vm_crds.yaml

Comment thread pkg/vendored/grafana-operator/crds/README.md Outdated
jthakkar04 and others added 3 commits August 3, 2026 13:42
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@jthakkar04
jthakkar04 force-pushed the jthakkar/install-telemetry-crds branch from 28228f1 to 997bfcc Compare August 3, 2026 18:48

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 3

🧹 Nitpick comments (1)
Makefile (1)

53-71: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Split the oversized target recipes.

checkmake reports generate-vendored and sync-crd-embed above the configured body-length limit. Move extraction and synchronization into helper targets or a script. Keep these targets as small orchestration targets.

Also applies to: 74-82

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@Makefile` around lines 53 - 71, Split the oversized recipes for
generate-vendored and sync-crd-embed into helper targets or a script that
performs the extraction and synchronization commands. Keep both named targets as
short orchestration targets invoking those helpers, while preserving their
existing outputs and behavior.

Source: Linters/SAST tools

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@internal/controller/reconciler/telemetry_chart_test.go`:
- Line 158: Update the comment above crdInstallerGroups to explain why it must
scan the rendered Helm manifest, focusing on the non-obvious validation purpose;
otherwise remove the comment rather than restating the helper’s behavior.
- Around line 149-151: Update the group validation loop in the telemetry chart
test to split the comma-separated groups value, trim each token, and verify
exact membership for “victoriametrics” and “grafana” instead of using
strings.Contains on the raw string.

In `@Makefile`:
- Around line 65-70: The Makefile CRD generation recipes must replace existing
artifacts only after every extraction or copy succeeds. At Makefile lines 65-70,
stage VictoriaMetrics and Grafana outputs in a temporary location, validate both
results, then atomically replace the vendored CRD directories; at lines 75-81,
stage all source copies first and replace internal/crdinstaller/crds only after
every copy completes successfully.

---

Nitpick comments:
In `@Makefile`:
- Around line 53-71: Split the oversized recipes for generate-vendored and
sync-crd-embed into helper targets or a script that performs the extraction and
synchronization commands. Keep both named targets as short orchestration targets
invoking those helpers, while preserving their existing outputs and behavior.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 361b6ec2-3c09-464f-80e4-c13dd67dd53b

📥 Commits

Reviewing files that changed from the base of the PR and between 28228f1 and 997bfcc.

📒 Files selected for processing (35)
  • Makefile
  • Tiltfile
  • deploy/operator/templates/_helpers.tpl
  • deploy/operator/values.yaml
  • internal/controller/reconciler/telemetry_chart_test.go
  • internal/crdinstaller/compose_test.go
  • internal/crdinstaller/crds/grafana/grafana.integreatly.org_grafanaalertrulegroups.yaml
  • internal/crdinstaller/crds/grafana/grafana.integreatly.org_grafanacontactpoints.yaml
  • internal/crdinstaller/crds/grafana/grafana.integreatly.org_grafanadashboards.yaml
  • internal/crdinstaller/crds/grafana/grafana.integreatly.org_grafanadatasources.yaml
  • internal/crdinstaller/crds/grafana/grafana.integreatly.org_grafanafolders.yaml
  • internal/crdinstaller/crds/grafana/grafana.integreatly.org_grafanalibrarypanels.yaml
  • internal/crdinstaller/crds/grafana/grafana.integreatly.org_grafanamutetimings.yaml
  • internal/crdinstaller/crds/grafana/grafana.integreatly.org_grafananotificationpolicies.yaml
  • internal/crdinstaller/crds/grafana/grafana.integreatly.org_grafananotificationpolicyroutes.yaml
  • internal/crdinstaller/crds/grafana/grafana.integreatly.org_grafananotificationtemplates.yaml
  • internal/crdinstaller/crds/grafana/grafana.integreatly.org_grafanas.yaml
  • internal/crdinstaller/crds/grafana/grafana.integreatly.org_grafanaserviceaccounts.yaml
  • internal/crdinstaller/crds/victoriametrics/vm_crds.yaml
  • internal/crdinstaller/embed.go
  • pkg/vendored/grafana-operator/crds/README.md
  • pkg/vendored/grafana-operator/crds/grafana.integreatly.org_grafanaalertrulegroups.yaml
  • pkg/vendored/grafana-operator/crds/grafana.integreatly.org_grafanacontactpoints.yaml
  • pkg/vendored/grafana-operator/crds/grafana.integreatly.org_grafanadashboards.yaml
  • pkg/vendored/grafana-operator/crds/grafana.integreatly.org_grafanadatasources.yaml
  • pkg/vendored/grafana-operator/crds/grafana.integreatly.org_grafanafolders.yaml
  • pkg/vendored/grafana-operator/crds/grafana.integreatly.org_grafanalibrarypanels.yaml
  • pkg/vendored/grafana-operator/crds/grafana.integreatly.org_grafanamutetimings.yaml
  • pkg/vendored/grafana-operator/crds/grafana.integreatly.org_grafananotificationpolicies.yaml
  • pkg/vendored/grafana-operator/crds/grafana.integreatly.org_grafananotificationpolicyroutes.yaml
  • pkg/vendored/grafana-operator/crds/grafana.integreatly.org_grafananotificationtemplates.yaml
  • pkg/vendored/grafana-operator/crds/grafana.integreatly.org_grafanas.yaml
  • pkg/vendored/grafana-operator/crds/grafana.integreatly.org_grafanaserviceaccounts.yaml
  • pkg/vendored/victoria-metrics-operator/crds/README.md
  • pkg/vendored/victoria-metrics-operator/crds/vm_crds.yaml
🚧 Files skipped from review as they are similar to previous changes (30)
  • deploy/operator/values.yaml
  • internal/crdinstaller/crds/grafana/grafana.integreatly.org_grafanaalertrulegroups.yaml
  • internal/crdinstaller/compose_test.go
  • internal/crdinstaller/crds/grafana/grafana.integreatly.org_grafanadatasources.yaml
  • Tiltfile
  • internal/crdinstaller/crds/grafana/grafana.integreatly.org_grafananotificationtemplates.yaml
  • deploy/operator/templates/_helpers.tpl
  • internal/crdinstaller/crds/grafana/grafana.integreatly.org_grafananotificationpolicyroutes.yaml
  • pkg/vendored/grafana-operator/crds/grafana.integreatly.org_grafananotificationtemplates.yaml
  • pkg/vendored/grafana-operator/crds/grafana.integreatly.org_grafananotificationpolicyroutes.yaml
  • pkg/vendored/grafana-operator/crds/README.md
  • pkg/vendored/grafana-operator/crds/grafana.integreatly.org_grafanafolders.yaml
  • internal/crdinstaller/crds/grafana/grafana.integreatly.org_grafanadashboards.yaml
  • internal/crdinstaller/crds/grafana/grafana.integreatly.org_grafanamutetimings.yaml
  • pkg/vendored/victoria-metrics-operator/crds/README.md
  • internal/crdinstaller/embed.go
  • internal/crdinstaller/crds/grafana/grafana.integreatly.org_grafanacontactpoints.yaml
  • internal/crdinstaller/crds/grafana/grafana.integreatly.org_grafananotificationpolicies.yaml
  • pkg/vendored/grafana-operator/crds/grafana.integreatly.org_grafanacontactpoints.yaml
  • pkg/vendored/grafana-operator/crds/grafana.integreatly.org_grafananotificationpolicies.yaml
  • internal/crdinstaller/crds/grafana/grafana.integreatly.org_grafanalibrarypanels.yaml
  • pkg/vendored/grafana-operator/crds/grafana.integreatly.org_grafanalibrarypanels.yaml
  • pkg/vendored/grafana-operator/crds/grafana.integreatly.org_grafanadatasources.yaml
  • pkg/vendored/grafana-operator/crds/grafana.integreatly.org_grafanamutetimings.yaml
  • internal/crdinstaller/crds/grafana/grafana.integreatly.org_grafanas.yaml
  • pkg/vendored/grafana-operator/crds/grafana.integreatly.org_grafanadashboards.yaml
  • internal/crdinstaller/crds/victoriametrics/vm_crds.yaml
  • pkg/vendored/grafana-operator/crds/grafana.integreatly.org_grafanaalertrulegroups.yaml
  • internal/crdinstaller/crds/grafana/grafana.integreatly.org_grafanafolders.yaml
  • pkg/vendored/grafana-operator/crds/grafana.integreatly.org_grafanas.yaml

Comment on lines +149 to +151
for _, g := range []string{"victoriametrics", "grafana"} {
if !strings.Contains(groups, g) {
t.Errorf("crd-installer --groups=%q missing %q", groups, g)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Match complete group names instead of substrings.

strings.Contains(groups, g) accepts malformed values such as victoriametrics-extra or grafana-extra. The test can pass without an exact --groups token. Split and trim the comma-separated value, then check exact membership.

Proposed assertion fix
-			groups := crdInstallerGroups(t, output)
+			groupValue := crdInstallerGroups(t, output)
+			groups := make(map[string]struct{})
+			for _, group := range strings.Split(groupValue, ",") {
+				groups[strings.TrimSpace(group)] = struct{}{}
+			}
 			for _, g := range []string{"victoriametrics", "grafana"} {
-				if !strings.Contains(groups, g) {
-					t.Errorf("crd-installer --groups=%q missing %q", groups, g)
+				if _, ok := groups[g]; !ok {
+					t.Errorf("crd-installer --groups=%q missing exact group %q", groupValue, g)
 				}
 			}
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
for _, g := range []string{"victoriametrics", "grafana"} {
if !strings.Contains(groups, g) {
t.Errorf("crd-installer --groups=%q missing %q", groups, g)
groupValue := crdInstallerGroups(t, output)
groups := make(map[string]struct{})
for _, group := range strings.Split(groupValue, ",") {
groups[strings.TrimSpace(group)] = struct{}{}
}
for _, g := range []string{"victoriametrics", "grafana"} {
if _, ok := groups[g]; !ok {
t.Errorf("crd-installer --groups=%q missing exact group %q", groupValue, g)
}
}
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@internal/controller/reconciler/telemetry_chart_test.go` around lines 149 -
151, Update the group validation loop in the telemetry chart test to split the
comma-separated groups value, trim each token, and verify exact membership for
“victoriametrics” and “grafana” instead of using strings.Contains on the raw
string.

}
}

// crdInstallerGroups returns the value of the crd-installer Job's --groups flag.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Explain why the helper scans rendered output.

The comment only restates crdInstallerGroups behavior. Rewrite it to explain the non-obvious reason for scanning the rendered Helm manifest, or remove it.

Proposed comment update
-// crdInstallerGroups returns the value of the crd-installer Job's --groups flag.
+// Scan rendered YAML so the test verifies the Helm hook's command arguments.

As per coding guidelines, **/*.{go,py,sh,bash}: Do not add inline comments that merely restate what code does; comments should concisely explain why, especially business logic or non-obvious behavior.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
// crdInstallerGroups returns the value of the crd-installer Job's --groups flag.
// Scan rendered YAML so the test verifies the Helm hook's command arguments.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@internal/controller/reconciler/telemetry_chart_test.go` at line 158, Update
the comment above crdInstallerGroups to explain why it must scan the rendered
Helm manifest, focusing on the non-obvious validation purpose; otherwise remove
the comment rather than restating the helper’s behavior.

Source: Coding guidelines

Comment thread Makefile
Comment on lines +65 to +70
@mkdir -p pkg/vendored/victoria-metrics-operator/crds pkg/vendored/grafana-operator/crds
@tar -xzOf deploy/operator/charts/victoria-metrics-operator-*.tgz victoria-metrics-operator/crd.yaml \
> pkg/vendored/victoria-metrics-operator/crds/vm_crds.yaml
@rm -f pkg/vendored/grafana-operator/crds/*.yaml
@tar -xzf deploy/operator/charts/grafana-operator-*.tgz -C pkg/vendored/grafana-operator/crds \
--strip-components=3 grafana-operator/files/crds

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win

Make CRD replacement all-or-nothing.

Both recipes remove or overwrite existing CRD artifacts before all reads and copies succeed. A failed tar or cp can leave generated inputs incomplete.

  • Makefile#L65-L70: stage VictoriaMetrics and Grafana extraction, validate the results, then replace vendored files.
  • Makefile#L75-L81: stage all source copies, then replace internal/crdinstaller/crds after every copy succeeds.
📍 Affects 1 file
  • Makefile#L65-L70 (this comment)
  • Makefile#L75-L81
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@Makefile` around lines 65 - 70, The Makefile CRD generation recipes must
replace existing artifacts only after every extraction or copy succeeds. At
Makefile lines 65-70, stage VictoriaMetrics and Grafana outputs in a temporary
location, validate both results, then atomically replace the vendored CRD
directories; at lines 75-81, stage all source copies first and replace
internal/crdinstaller/crds only after every copy completes successfully.

@jthakkar04 jthakkar04 changed the title feat: Install telemetry CRDs via crd-installer so off→full upgrades work feat: Install telemetry CRDs via crd-installer Aug 3, 2026
{{- if (dig "altinity-clickhouse-operator" "enabled" false .Values.AsMap) -}}
{{- $groups = append $groups "clickhouse" -}}
{{- end -}}
{{- /* Telemetry CRDs install in every mode so an off→full upgrade never has to add CRDs. */ -}}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

we should only install this when they are needed, but the difference is that the crd-installer will install them during a helm upgrade if they are enabled, which the helm charts were not doing.

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.

2 participants