Skip to content

Wrong relative paths in included files #1301

@Psy-Kai

Description

@Psy-Kai

Describe the bug

If you have relative paths in included compose files podman-compose does not adjust the paths to the root compose file.

To Reproduce

Assume the following structure

# /dev.yml
include:
  - ./dev/db.yml
# /dev/db.yml
services:
  db:
    image: ubuntu
    env_file:
      - ./db/.env
# /dev/db/.env
FOO="bar"

Steps to reproduce the behavior:

  1. just call `podman-compose -f dev.yml config

Expected behavior
The config output should look something like

services:
  db:
    image:ubuntu
  env_file:
    ./dev/db/.env

or better

services:
  db:
    image:ubuntu
  env_file:
    /path/to/my/work/directory/dev/db/.env

Actual behavior
The config looks like

services:
  db:
    image:ubuntu
  env_file:
    ./db/.env

Additional context

It seems like the compose files are just merged. But the spec states, that:

Each path listed in the include section is loaded as an individual Compose application model, with its own project directory, in order to resolve relative paths.

So just merging the files and then processing it (as it seems to be implemented currently) will not work.

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