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

Multiple services cannot have the same links alias refer to different services #1071

Open
jefferyto opened this issue Nov 6, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@jefferyto
Copy link

Describe the bug
When multiple (source) services use the same links alias to refer to different (target) services, the alias ends up referring to the same target service within every source service.

To Reproduce
With this compose.yaml:

services:
  a:
    image: "docker.io/library/alpine"
    entrypoint: [ 'sleep', '600' ]

  b:
    image: "docker.io/library/alpine"
    entrypoint: [ 'sleep', '600' ]

  c:
    image: "docker.io/library/alpine"
    entrypoint: [ 'sleep', '600' ]
    links:
      - "a:foo"

  d:
    image: "docker.io/library/alpine"
    entrypoint: [ 'sleep', '600' ]
    links:
      - "b:foo"

Steps to reproduce the behavior:

  1. podman-compose up -d
  2. Check the IP address of foo within c and d:
$ podman-compose exec c ping -c 1 foo
PING foo (10.89.0.2): 56 data bytes
64 bytes from 10.89.0.2: seq=0 ttl=42 time=0.135 ms

--- foo ping statistics ---
1 packets transmitted, 1 packets received, 0% packet loss
round-trip min/avg/max = 0.135/0.135/0.135 ms
$ podman-compose exec d ping -c 1 foo
PING foo (10.89.0.2): 56 data bytes
64 bytes from 10.89.0.2: seq=0 ttl=42 time=0.118 ms

--- foo ping statistics ---
1 packets transmitted, 1 packets received, 0% packet loss
round-trip min/avg/max = 0.118/0.118/0.118 ms
$

Expected behavior
foo is an alias to a (10.89.0.2) within c, foo is an alias to b (10.89.0.3) within d.

Actual behavior
foo is an alias to a (10.89.0.2) within both c and d.

What ends up happening is that foo gets 2 IP addresses within all services:

$ podman-compose exec d nslookup foo
Server:         10.89.0.1
Address:        10.89.0.1:53

Non-authoritative answer:
Name:   foo.dns.podman
Address: 10.89.0.2
Name:   foo.dns.podman
Address: 10.89.0.3

Non-authoritative answer:

$

Environment:

  • OS: Ubuntu 24.10 (oracular)
  • podman version: 5.0.3 (deb version: 5.0.3+ds1-5ubuntu1)
  • podman compose version: 1.2.0 (deb version: 1.2.0-1)
  • netavark version: 1.9.0 (deb version: 1.9.0-4)
  • aardvark-dns version: 1.9.0 (deb version: 1.9.0-2)
@jefferyto jefferyto added the bug Something isn't working label Nov 6, 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