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

Incorrect implementation of include #999

Open
legobeat opened this issue Jul 12, 2024 · 1 comment
Open

Incorrect implementation of include #999

legobeat opened this issue Jul 12, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@legobeat
Copy link
Contributor

legobeat commented Jul 12, 2024

Describe the bug

Looking at compose spec (which docker-compose conforms with here), this should be valid:

include:
   - path: ../commons/compose.yaml
     project_directory: ..
     env_file: ../another/.env
   - path: composefiles/compose2.yaml
     project_directory: ./project2
     env_file: ./envfiles/project2

Yet, this causes a runtime error at

if filename.strip().split('/')[-1] == '-':
:

AttributeError: 'dict' object has no attribute 'strip'

Looking at the implementation, only the "short syntax" is supported and attempting use of the long syntax causes a crash.

This also means that it's not possible to make use of project_directory or env_file for includes.

Looking at the current implementation, it also seems that even if this is addressed, it would still not properly merge multiple entries in env_file unless the handling of env files is reworked.

Additional context

Going back in history, this was always part of the include spec, so podman-compose does not implement an older version here - it's simply incorrect/incomplete?

Related:

@legobeat legobeat added the bug Something isn't working label Jul 12, 2024
@legobeat legobeat changed the title Incorrect implemetation of include Incorrect implementation of include Jul 29, 2024
legobeat pushed a commit to legobeat/l7-devenv that referenced this issue Jul 29, 2024
legobeat added a commit to legobeat/l7-devenv that referenced this issue Jul 29, 2024
@happened
Copy link

same issue

Traceback (most recent call last):
File "/data/software/miniconda3/envs/rag/bin/podman-compose", line 8, in
sys.exit(main())
File "/data/software/miniconda3/envs/rag/lib/python3.10/site-packages/podman_compose.py", line 3504, in main
asyncio.run(async_main())
File "/data/software/miniconda3/envs/rag/lib/python3.10/asyncio/runners.py", line 44, in run
return loop.run_until_complete(main)
File "/data/software/miniconda3/envs/rag/lib/python3.10/asyncio/base_events.py", line 649, in run_until_complete
return future.result()
File "/data/software/miniconda3/envs/rag/lib/python3.10/site-packages/podman_compose.py", line 3500, in async_main
await podman_compose.run()
File "/data/software/miniconda3/envs/rag/lib/python3.10/site-packages/podman_compose.py", line 1741, in run
self._parse_compose_file()
File "/data/software/miniconda3/envs/rag/lib/python3.10/site-packages/podman_compose.py", line 1835, in _parse_compose_file
if filename.strip().split('/')[-1] == '-':
AttributeError: 'dict' object has no attribute 'strip'

legobeat added a commit to legobeat/l7-devenv that referenced this issue Jul 30, 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

2 participants