chore: handle OTEL vars the same in helm v3/v4 - #1204
Conversation
Signed-off-by: Matt Kornfield <mkornfield@nvidia.com>
c9a258c to
0fa1d9c
Compare
📝 WalkthroughWalkthroughThe Helm OTEL environment helper now omits invalid telemetry values. Helm lint checks that null endpoints are omitted and explicit empty-string endpoints are rendered. ChangesOTEL environment rendering
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
tools/lint/lint-helm.sh (1)
196-197: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick winAssert the empty value, not only the variable name.
The checks at Line 196 and Line 197 pass when the endpoint names have any value. Match each endpoint name with its following
value: ""entry and fail each assertion independently.Proposed assertion change
-if grep -Fq "OTEL_EXPORTER_OTLP_METRICS_ENDPOINT" <<<"${otel_explicit_empty_output}" -grep -Fq "OTEL_EXPORTER_OTLP_TRACES_ENDPOINT" <<<"${otel_explicit_empty_output}" +if ! grep -A1 -F -- "name: OTEL_EXPORTER_OTLP_METRICS_ENDPOINT" \ + <<<"${otel_explicit_empty_output}" | grep -Fq -- 'value: ""'; then + echo "Explicit empty OTEL metrics endpoint was not rendered" >&2 + exit 1 +fi +if ! grep -A1 -F -- "name: OTEL_EXPORTER_OTLP_TRACES_ENDPOINT" \ + <<<"${otel_explicit_empty_output}" | grep -Fq -- 'value: ""'; then + echo "Explicit empty OTEL traces endpoint was not rendered" >&2 + exit 1 +fi🤖 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 `@tools/lint/lint-helm.sh` around lines 196 - 197, Update the assertions in the otel_explicit_empty_output checks to match each endpoint variable name together with its following value: "" entry, rather than matching only the variable name. Keep the metrics and traces assertions separate so either mismatch fails independently.
🤖 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.
Nitpick comments:
In `@tools/lint/lint-helm.sh`:
- Around line 196-197: Update the assertions in the otel_explicit_empty_output
checks to match each endpoint variable name together with its following value:
"" entry, rather than matching only the variable name. Keep the metrics and
traces assertions separate so either mismatch fails independently.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: 82f793ce-7030-482c-807e-23bcaacd59db
📒 Files selected for processing (2)
k8s/helm/templates/_helpers.tpltools/lint/lint-helm.sh
|
crookedstorm
left a comment
There was a problem hiding this comment.
Null isn't great anyway, but this works
Summary
Related Issue
Changes
Type of Change
Quality Gates
Verification
Signed-off-by:traileruv run pre-commit run -apasses, or any blocked checks are identified belowTargeted validation:
Summary by CodeRabbit
Bug Fixes
Tests