-
Notifications
You must be signed in to change notification settings - Fork 138
Process EnvFileDir in file-based config mode #2470
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Fixes vault secrets not being passed to workload pods when using file-based configuration in the proxy runner. The runWithFileBasedConfig function was loading the RunConfig from the ConfigMap but never processing the EnvFileDir field. This caused Vault Agent injected secrets to remain in the proxy pod at /vault/secrets without being propagated to the workload StatefulSet. The fix adds environment file processing when EnvFileDir is set, matching the behavior of the flags-based configuration path. When the operator detects Vault annotations, it sets EnvFileDir to /vault/secrets in the RunConfig. The proxy runner now reads files from that directory and merges them into config.EnvVars before deploying the workload. Fixes #2460
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2470 +/- ##
==========================================
+ Coverage 55.39% 55.44% +0.05%
==========================================
Files 281 284 +3
Lines 26609 26720 +111
==========================================
+ Hits 14739 14816 +77
- Misses 10514 10540 +26
- Partials 1356 1364 +8 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR fixes a bug where Vault-injected secrets were not being propagated to workload pods when using file-based configuration in the proxy runner. The core issue was that the EnvFileDir field in the RunConfig was being loaded but never processed.
Key Changes:
- Added environment file processing in the file-based config path to read and merge secrets from
EnvFileDir - Added test coverage for the
WithEnvFilesFromDirectorypattern used in the fix
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| cmd/thv-proxyrunner/app/execution.go | Adds processing of EnvFileDir to load environment variables from files (e.g., Vault secrets) |
| cmd/thv-proxyrunner/app/run_test.go | Adds test verifying that environment files are correctly loaded and merged with existing env vars |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
@claude please review this |
|
Claude finished @JAORMX's task —— View job Code Review Complete
SummaryThis PR successfully fixes the bug where Vault-injected secrets were not being propagated to workload pods when using file-based configuration. The fix is straightforward, well-tested, and follows the existing patterns in the codebase. Positive Findings
Observations
Minor Suggestions (Non-blocking)
VerdictLGTM ✅ This is a solid fix that:
The code is ready to merge. |
Fixes vault secrets not being passed to workload pods when using file-based configuration in the proxy runner.
The runWithFileBasedConfig function was loading the RunConfig from the ConfigMap but never processing the EnvFileDir field. This caused Vault Agent injected secrets to remain in the proxy pod at /vault/secrets without being propagated to the workload StatefulSet.
The fix adds environment file processing when EnvFileDir is set, matching the behavior of the flags-based configuration path. When the operator detects Vault annotations, it sets EnvFileDir to /vault/secrets in the RunConfig. The proxy runner now reads files from that directory and merges them into config.EnvVars before deploying the workload.
Fixes #2460