Skip to content
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

podman-compose accepts non-standard type extension for secrets #1091

Open
ETCaton opened this issue Dec 26, 2024 · 0 comments
Open

podman-compose accepts non-standard type extension for secrets #1091

ETCaton opened this issue Dec 26, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@ETCaton
Copy link

ETCaton commented Dec 26, 2024

Describe the bug

In the process of implementing #971 it looks like

        - 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 on a project that used this, but you can trivially replicate as follows:

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
@ETCaton ETCaton added the bug Something isn't working label Dec 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant