Commit ad938e2
fix(control-plane): inject AMBIENT_TOKEN into MCP sidecar at pod creation (#1274)
## Summary
- The `ambient-mcp` sidecar uses the Go SDK which requires
`AMBIENT_TOKEN` to start
- Fetches the CP's current API token via `factory.Token(ctx)` at
pod-creation time and injects it as `AMBIENT_TOKEN` into the sidecar env
- If token fetch fails, logs a warning and starts the sidecar without it
(non-fatal)
Fixes: MCP sidecar crash `AMBIENT_TOKEN is required` (seen in
mpp-openshift runner pods)
## Test plan
- [ ] Deploy mpp-openshift overlay with this change
- [ ] Start a session and confirm the `ambient-mcp` sidecar starts
successfully (no `AMBIENT_TOKEN is required` crash)
- [ ] Confirm MCP tools are reachable from the runner at
`http://localhost:8090`
🤖 Generated with [Claude Code](https://claude.ai/code)
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
* **Bug Fixes**
* Improved MCP sidecar pod resilience. Ambient token retrieval failures
now trigger warning logs instead of blocking pod creation, allowing the
configuration process to continue with default settings. Sidecar
environment variables are now dynamically constructed based on available
tokens, enabling more flexible deployment configurations.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
Co-authored-by: Ambient Code Bot <bot@ambient-code.local>
Co-authored-by: Claude <noreply@anthropic.com>1 parent 6c8f09c commit ad938e2
File tree
1 file changed
+18
-9
lines changed- components/ambient-control-plane/internal/reconciler
1 file changed
+18
-9
lines changedLines changed: 18 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
441 | 441 | | |
442 | 442 | | |
443 | 443 | | |
444 | | - | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
445 | 450 | | |
446 | 451 | | |
447 | 452 | | |
| |||
811 | 816 | | |
812 | 817 | | |
813 | 818 | | |
814 | | - | |
| 819 | + | |
815 | 820 | | |
816 | 821 | | |
817 | 822 | | |
818 | 823 | | |
819 | 824 | | |
| 825 | + | |
| 826 | + | |
| 827 | + | |
| 828 | + | |
| 829 | + | |
| 830 | + | |
| 831 | + | |
| 832 | + | |
| 833 | + | |
| 834 | + | |
820 | 835 | | |
821 | 836 | | |
822 | 837 | | |
| |||
828 | 843 | | |
829 | 844 | | |
830 | 845 | | |
831 | | - | |
832 | | - | |
833 | | - | |
834 | | - | |
835 | | - | |
836 | | - | |
837 | | - | |
| 846 | + | |
838 | 847 | | |
839 | 848 | | |
840 | 849 | | |
| |||
0 commit comments