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

[BUG] depends_on stripped for extended services #12402

Closed
stormshield-fabs opened this issue Dec 18, 2024 · 3 comments · Fixed by compose-spec/compose-go#721
Closed

[BUG] depends_on stripped for extended services #12402

stormshield-fabs opened this issue Dec 18, 2024 · 3 comments · Fixed by compose-spec/compose-go#721

Comments

@stormshield-fabs
Copy link

Description

When a service uses both extends and depends_on, the depends_on map is stripped in the rendered configuration.

Steps To Reproduce

Run docker compose config with the following file

services:
  service_a:
    image: alpine:latest
  
  service_b:
    extends: service_a
    depends_on:
      service_a:
        condition: service_completed_successfully

Docker 27.4.0 (compose 2.31.0):

name: docker
services:
  service_a:
    image: alpine:latest
    networks:
      default: null
  service_b:
    depends_on:
      service_a:
        condition: service_completed_successfully
        required: true
    image: alpine:latest
    networks:
      default: null
networks:
  default:
    name: docker_default

Docker 27.4.1 (compose 2.32.1):

name: docker
services:
  service_a:
    image: alpine:latest
    networks:
      default: null
  service_b:
    image: alpine:latest
    networks:
      default: null
networks:
  default:
    name: docker_default

(note the missing depends_on)

Compose Version

Docker Compose version v2.32.1

Docker Environment

Client: Docker Engine - Community
 Version:    27.4.1
 Context:    default
 Debug Mode: false
 Plugins:
  buildx: Docker Buildx (Docker Inc.)
    Version:  v0.19.3
    Path:     /usr/libexec/docker/cli-plugins/docker-buildx
  compose: Docker Compose (Docker Inc.)
    Version:  v2.32.1
    Path:     /usr/libexec/docker/cli-plugins/docker-compose

Server:
 Containers: 0
  Running: 0
  Paused: 0
  Stopped: 0
 Images: 16
 Server Version: 27.4.1
 Storage Driver: overlay2
  Backing Filesystem: extfs
  Supports d_type: true
  Using metacopy: false
  Native Overlay Diff: true
  userxattr: false
 Logging Driver: json-file
 Cgroup Driver: systemd
 Cgroup Version: 2
 Plugins:
  Volume: local
  Network: bridge host ipvlan macvlan null overlay
  Log: awslogs fluentd gcplogs gelf journald json-file local splunk syslog
 Swarm: inactive
 Runtimes: runc io.containerd.runc.v2
 Default Runtime: runc
 Init Binary: docker-init
 containerd version: 88bf19b2105c8b17560993bee28a01ddc2f97182
 runc version: v1.2.2-0-g7cb3632
 init version: de40ad0
 Security Options:
  apparmor
  seccomp
   Profile: builtin
  cgroupns
 Kernel Version: 6.8.0-49-generic
 Operating System: Ubuntu 22.04.5 LTS
 OSType: linux
 Architecture: x86_64
 CPUs: 12
 Total Memory: 31.01GiB
 Name: REDACTED
 ID: e6b3efa0-3763-471b-96a3-9166fee1ce35
 Docker Root Dir: /var/lib/docker
 Debug Mode: false
 Experimental: false
 Insecure Registries:
  127.0.0.0/8
 Live Restore Enabled: false

Anything else?

This might be related to #12360 and compose-spec/compose-go#718

@stormshield-fabs stormshield-fabs changed the title [BUG] depends_on stripped for extended nodes [BUG] depends_on stripped for extended services Dec 19, 2024
@ndeloof
Copy link
Contributor

ndeloof commented Dec 19, 2024

This is indeed related to this PR and is intentional, as described in the documentation: depends_on is excluded when a service is used as source by extends

@ndeloof ndeloof closed this as not planned Won't fix, can't repro, duplicate, stale Dec 19, 2024
@ap-wtioit
Copy link

@ndeloof i would argue that volumes_from and depends_on are never shared between services using extends in the example it is not "shared" from service_a to service_b and explicitly defined as depends_on in service_b and nonetheless stripped in the config from service_b. Are you refering to a different section of the documentation?

Note: this also breaks our project/doodba

@ndeloof
Copy link
Contributor

ndeloof commented Dec 19, 2024

hum indeed, that definitely a bug here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants