Fix env injection crashing on variables the compose file also sets #3
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/env-override-merge"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Fixes deploys failing when an app's compose file sets a variable that is also in the panel's Environment tab while Pass to every container is on (the default).
The bug
prepare_env_overridewrote bare keys:podman-compose 1.5 normalises a bare key to
Noneand refuses to merge it with the compose file's own value:So any app that documents its settings as
FOO: ${FOO:-default}(the pattern the Environment tab's "uses variables that aren't set" hint encourages) couldn't be deployed with injection on.The fix
Write
KEY: ${KEY}instead. Compose still fills the value in from its own environment (where panelctl already puts it), so values are still never quoted into YAML, and the panel's value still takes precedence.Verified with podman-compose 1.5.0
environment:- FOO=x)FOO: x)$and quotes (p$1 "x") passes through unchanged, with no re-interpolation.panelctl.shagainst reudy-net/oweme'scompose.yaml; the values reach the service.bash -n panelctl.shpasses.nix flake checkand a full deploy on the VPS. This box has no Nix and no panel install.The README's Environment variables section is updated to match.
🤖 Generated with Claude Code
https://claude.ai/code/session_013FYo6JSV1fDU1fm3LU77iF
The env override listed bare keys (- KEY). podman-compose can't merge a bare key with a value the compose file sets for the same variable and fails the deploy: "can't merge value of [KEY] of type str and NoneType". Writing KEY: ${KEY} keeps values out of the YAML (compose interpolates them from its environment) and merges with list- or map-form environment. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013FYo6JSV1fDU1fm3LU77iFView command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.