containers / containers/podman-compose
`podman-compose` accepts non-standard `type` extension for secrets
- Dominant language
- Python
- Stars
- 6.2k
- Forks
- 622
- PR merge metrics
- No merged PRs in 30d
Description
**Describe the bug**
In the process of implementing #971 it looks like
```yml
- source: my_secret
target: ENV_SECRET
type: env
```
was added to support setting environment variables, however `type:` is not a standard key for a secret per the Compose spec: https://github.com/compose-spec/compose-spec/blob/main/09-secrets.md.
It should likely be `x-type:` as it would be a Podman Compose extension (or potentially reverted as it seems Docker Compose has its own workaround to accomplish this already: https://stackoverflow.com/questions/48094850/docker-stack-setting-environment-variable-from-secrets/)
**To Reproduce**
Steps to reproduce the behavior:
I noticed this while using [`podlet`](https://github.com/containers/podlet) on a project that used this, but you can trivially replicate as follows:
```sh
❯ command -v podlet && git clone "https://github.com/containers/podman-compose" && cd podman-compose/tests/integration/secrets && podlet compose
```
**Expected output (since this refers to secrets not supported by `podlet` yet)**
```
Error:
0: error converting compose file
1: only external `secrets` are supported
Location:
src/cli/compose.rs:136
Backtrace omitted. Run with RUST_BACKTRACE=1 environment variable to display it.
Run with RUST_BACKTRACE=full to include source snippets.
```
**Actual output**
```
Error:
0: error converting compose file
1: error reading compose file
2: File `docker-compose.yaml` is not a valid compose file
3: services.test.secrets[7]: extension key `type` does not start with "x-" at line 34 column 11
Location:
src/cli/compose.rs:203
Backtrace omitted. Run with RUST_BACKTRACE=1 environment variable to display it.
Run with RUST_BACKTRACE=full to include source snippets.
```
**Environment:**
- OS: Mac
- podman-compose version 1.2.0
- podman version 5.3.1
- podlet version: 0.3.0
Contributor guide
Assessment
This issue has not been assessed yet.