fix(nvca): inject BYOO env vars into Helm utils collector#346
Conversation
📝 WalkthroughWalkthroughBYOO collector environment variables are now injected directly into the utils pod while remaining in metadata input. Reconciliation tests verify the collector sidecar environment and update expected log chunking values. ChangesBYOO collector environment handling
Estimated code review effort: 2 (Simple) | ~10 minutes Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 golangci-lint (2.12.2)level=error msg="[linters_context] typechecking error: pattern ./...: directory prefix . does not contain main module or its selected dependencies" Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
src/compute-plane-services/nvca/internal/miniservice/reconcile_test.go (1)
662-676: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winAssert the full collector environment contract in the sidecar.
BYOOOTelCollectorEnvVars()also includes metric-subset and workload-metrics variables, but this new pod assertion checks only the three log-related keys. The later metadata assertions do not prove those additional values were injected into the sidecar; add equivalent sidecar assertions or compare against the complete expected env set.Proposed test extension
assert.Equal(t, "262144", byooCollectorEnv[nvcaconfig.BYOOLogChunkMaxBodyBytesEnv]) assert.Equal(t, "true", byooCollectorEnv[nvcaconfig.BYOOLogChunkDryRunEnv]) assert.Equal(t, "1000000", byooCollectorEnv[nvcaconfig.BYOOLogExporterBatchMaxSizeBytesEnv]) + assert.Equal(t, "true", byooCollectorEnv[nvcaconfig.BYOOMetricSubsetEnabledEnv]) + assert.Contains(t, byooCollectorEnv[nvcaconfig.BYOOMetricSubsetFilterConfigEnv], "metric.name") + assert.Equal(t, "metric_subset_enabled,custom_label", + byooCollectorEnv[nvcaconfig.BYOOWorkloadMetricsDropLabelsEnv])🤖 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 `@src/compute-plane-services/nvca/internal/miniservice/reconcile_test.go` around lines 662 - 676, The sidecar test only validates three log-related environment variables and misses the metric-subset and workload-metrics values from BYOOOTelCollectorEnvVars(). Extend the assertions for byooCollectorEnv in the existing utils pod test to cover every expected collector environment variable, or compare the collected environment against the complete expected set returned by BYOOOTelCollectorEnvVars(), while preserving the current log assertions.
🤖 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 `@src/compute-plane-services/nvca/internal/miniservice/reconcile_test.go`:
- Around line 662-676: The sidecar test only validates three log-related
environment variables and misses the metric-subset and workload-metrics values
from BYOOOTelCollectorEnvVars(). Extend the assertions for byooCollectorEnv in
the existing utils pod test to cover every expected collector environment
variable, or compare the collected environment against the complete expected set
returned by BYOOOTelCollectorEnvVars(), while preserving the current log
assertions.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: cb106089-36b3-4e71-ba4e-e2fb0d3552d5
📒 Files selected for processing (2)
src/compute-plane-services/nvca/internal/miniservice/reconcile.gosrc/compute-plane-services/nvca/internal/miniservice/reconcile_test.go
TL;DR
Inject BYOO OTel collector environment variables directly into the collector sidecar on Helm-generated
utilspods.The webhook special-cases
utilspods and skips the normal metadata-based environment injection. Consequently, log-chunking settings were present in MiniService metadata but absent from the collector, causing oversized logs to be exported without chunking.Additional Details (optional for docs, build, test, refactor, ci, chore, style, and revert PRs)
BYOOOTelCollectorEnvVars()directly to the generated Helmutilspod usingAddBYOOEnvVarsToPodSpec.byoo-otel-collectorsidecar.BYOOOTelCollectorEnvVars()keeps this compatible with additional collector settings introduced by feat(byoo): gate collector config env vars #194.BYOO_LOG_CHUNK_MAX_BODY_BYTES=262144BYOO_LOG_CHUNK_DRY_RUN=trueBYOO_LOG_EXPORTER_BATCH_MAX_SIZE_BYTES=1000000Related: #194
For the Reviewer
Please review:
src/compute-plane-services/nvca/internal/miniservice/reconcile.goutilspod is the appropriate scope.src/compute-plane-services/nvca/internal/miniservice/reconcile_test.goFor QA (optional for docs, build, test, refactor, ci, chore, style, and revert PRs)
Local verification:
GOWORK=off go test ./internal/miniservice/ -run 'TestReconcile_Function$' -count=1 -ldflags '-X github.com/NVIDIA/k8s-dra-driver-gpu/internal/info.version=v25.8.0'Result: passed.
QA is recommended in staging:
byoo-otel-collectorcontainer on the generatedutilspod.BYOO_LOG_*environment variables are present.Issues
NO-REF
Checklist
Summary by CodeRabbit