feat: valueFrom.fromBinding env var projection#432
Open
JamesSprow wants to merge 5 commits into
Open
Conversation
Allow users to project specific keys from bound app credentials into
custom-named env vars via `valueFrom.fromBinding.{ref, key}` on the
CRD spec. Also fixes `valueFrom.secretRef` resolution (was declared
on the CRD but never resolved by the controller), fixes a flash/
disappear bug on the Bindings and Credentials section + buttons
caused by SSE-triggered $effect re-runs, and rewires BindingsPicker
to write real CRD fields instead of the non-functional ${{bindings}}
template syntax.
Co-Authored-By: Claude Opus 4.6 <[email protected]>
Route fromBinding-resolved env vars into the binding-source list so
they survive the ReplaceSource("binding", ...) call that manages
auto-injected vars. Also fix E2E selectors: scope picker assertions
to the picker panel to avoid strict mode violations, and fix the
auto-injected button title assertion.
Co-Authored-By: Claude Opus 4.6 <[email protected]>
- Increase DB_PASS visibility timeout to 15s (controller reconcile needed) - Use .first() for binding badge assertion (multiple badges in section) - Add exact: true to Projects heading assertion (navigation.spec.ts) Co-Authored-By: Claude Opus 4.6 <[email protected]>
Co-Authored-By: Claude Opus 4.6 <[email protected]>
- Append fromBinding vars after auto-generated binding vars so explicit user projections win when names collide (was prepending, which let auto-generated vars silently overwrite user intent) - Add exact: true to getByRole calls in E2E tests Co-Authored-By: Claude Opus 4.6 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
valueFrom.fromBinding: New CRD field onEnvVarlets users project specific keys from bound app credentials into custom-named env vars (e.g.DB_PASSfrompg.password). Resolver validates the ref is in the env's bindings list and the key exists on the bound app.valueFrom.secretReffix: The field existed on the CRD but the controller never resolved it. Now reads the referenced Secret from the env namespace.+buttons would flash a new row then immediately disappear due to SSE-triggered$effectre-runs resetting UI state. Fixed withlastLoadedEnv/lastLoadedAppguards.${{bindings.X.Y}}template syntax with real CRD field writes. Picker now writesfromBindingorsecretRefentries to the app spec, and the UI displays binding vars with a "binding" badge andref -> keydisplay.GET /binding-keysendpoint returns available keys for a bound app.GET /envresponse enriched withbindingRef/bindingKeymetadata.Scope note
SPEC S5.8b says
fromBindingis supported in bothsharedVarsandenv. This PR implements it forenvonly.sharedVarssupport is intentionally deferred -- shared vars are app-level (not per-environment), which raises scoping questions about which environment's bindings list to validate against. Will address in a follow-up.Changes
app_types.go, deepcopy, CRD YAMLBindingVarSourcestruct,FromBindingfield onEnvVarSourceresolver.go,resolver_test.goResolveSingle(),AvailableKeys()+ 10 new testsapp_controller.go,app_controller_test.goresolveEnvVarValue()for literal/secretRef/fromBinding + 7 testsbindings.go,env.go,server.goapp-variables-full.spec.ts,bindings.spec.tsbindings_test.goTestFromBindingProjectsNamedKeyTest plan
svelte-checkpasses (0 errors)Generated with Claude Code