fix(operator): Resolve boolean CR fields as env values - #320
fix(operator): Resolve boolean CR fields as env values#320casey-coreweave wants to merge 1 commit into
Conversation
📝 WalkthroughWalkthroughCustom-resource environment resolution now accepts string and boolean fields. Boolean values become lowercase environment-variable strings. Tests cover valid values, rejected fields, direct resolution, and manifest-based bucket-proxy propagation. ChangesCustom-resource environment resolution
Estimated code review effort: 3 (Moderate) | ~20 minutes Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
internal/controller/reconciler/oidc_env_test.go (1)
62-95: 📐 Maintainability & Code Quality | 🔵 Trivial | 🏗️ Heavy liftUse Ginkgo/Gomega for the new test cases.
Convert these
Test...functions and subtests into the repository Ginkgo/Gomega suite. Keep coverage for bothtrueandfalsevalues.As per coding guidelines, “Use Ginkgo/Gomega for tests; test suites are configured through
suite_test.gofiles and envtest.”Also applies to: 138-165, 167-203
🤖 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/oidc_env_test.go` around lines 62 - 95, Convert TestResolveCRFieldEnvValue and the additionally referenced test functions into the repository’s Ginkgo/Gomega suite, replacing testing.T subtests, Fatalf, and Fatal calls with the suite’s Describe/It structure and Gomega assertions. Preserve all existing coverage, including both true and false bucketProxy values, and use the established suite setup from the relevant suite_test.go/envtest configuration.Source: Coding guidelines
🤖 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 `@internal/controller/reconciler/oidc_env_test.go`:
- Around line 62-95: Convert TestResolveCRFieldEnvValue and the additionally
referenced test functions into the repository’s Ginkgo/Gomega suite, replacing
testing.T subtests, Fatalf, and Fatal calls with the suite’s Describe/It
structure and Gomega assertions. Preserve all existing coverage, including both
true and false bucketProxy values, and use the established suite setup from the
relevant suite_test.go/envtest configuration.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: bccfe637-a709-422d-a526-257f8b2907f7
📒 Files selected for processing (3)
internal/controller/reconciler/oidc_env_test.gointernal/controller/reconciler/pods.gointernal/controller/reconciler/reconcile_v2.go
This change casts boolean types correctly for passed through CR env fields. This allows the typing on the CR to correctly validate fields.
Boolean fields such as
spec.wandb.bucketProxyare silently omitted, causing the API and filemeta workloads to miss their bucket-proxy configuration.This change renders boolean values as lowercase true/false, while preserving existing string and secret-selector behavior and rejecting unsupported structured values.
Summary by CodeRabbit
New Features
Bug Fixes