Skip to content

Incorrect implementation of include #999

Open
@legobeat

Description

@legobeat

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:

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions