Skip to content

Override fails when using reset to clear depends_on parameter #1198

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

Open
Are10 opened this issue May 12, 2025 · 0 comments · May be fixed by #1208
Open

Override fails when using reset to clear depends_on parameter #1198

Are10 opened this issue May 12, 2025 · 0 comments · May be fixed by #1208
Labels
bug Something isn't working

Comments

@Are10
Copy link

Are10 commented May 12, 2025

Describe the bug
I am trying to remove a service using an override file.
Clearing an entire service works fine, using !reset null, but removing the associated depends_on parameter fails.

Using the feature recently added in #1189

To Reproduce
Steps to reproduce the behavior:

  1. Setup:
apt-get install podman python3-dotenv
mkdir -p .local/bin
curl -o ~/.local/bin/podman-compose https://raw.githubusercontent.com/containers/podman-compose/main/podman_compose.py
chmod +x .local/bin/podman-compose
export PODMAN_COMPOSE_PROVIDER='/root/.local/bin/podman-compose'
  1. Create a compose and an override file
version: "3.7"
services:
  frontend:
    image: busybox
    depends_on:
      - db
    command: ["/bin/busybox", "httpd", "-f", "-p", "8080"]
    ports:
      - "8080"

  db:
    image: busybox
version: "3"
services:
  backend:
    depends_on: !reset null
  db: !reset null
  1. Parse the config files
    podman compose -f docker-compose.yml -f override.yml config

Expected behavior
I expect to see a parsed config without the db service and the 'depends_on' in the frontend service

Actual behavior
podman-compose exits with the following error message:

Traceback (most recent call last):
  File "/root/.local/bin/podman-compose", line 3999, in <module>
    main()
  File "/root/.local/bin/podman-compose", line 3995, in main
    asyncio.run(async_main())
  File "/usr/lib/python3.12/asyncio/runners.py", line 194, in run
    return runner.run(main)
           ^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/asyncio/runners.py", line 118, in run
    return self._loop.run_until_complete(task)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/asyncio/base_events.py", line 687, in run_until_complete
    return future.result()
           ^^^^^^^^^^^^^^^
  File "/root/.local/bin/podman-compose", line 3991, in async_main
    await podman_compose.run()
  File "/root/.local/bin/podman-compose", line 1982, in run
    self._parse_compose_file()
  File "/root/.local/bin/podman-compose", line 2091, in _parse_compose_file
    content = normalize(content)
              ^^^^^^^^^^^^^^^^^^
  File "/root/.local/bin/podman-compose", line 1735, in normalize
    normalize_service(service)
  File "/root/.local/bin/podman-compose", line 1723, in normalize_service
    for k, v in deps.items():
                ^^^^^^^^^^

Output


**Environment:**
 - OS: Linux "Ubuntu 24.04.2 LTS"
 - podman version: 4.9.3
 - podman compose version: 1.4.0

Additional context

  • Using just !reset on the service parses correctly, the issue appears when using !reset on the 'depends_on' parameter.
  • I also tried using !reset [] and !reset {}, but the effect was the same
@Are10 Are10 added the bug Something isn't working label May 12, 2025
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

Successfully merging a pull request may close this issue.

1 participant