Skip to content

depends_on required property error #10804

@ShahimEssaid

Description

@ShahimEssaid

Description

The handling of depneds_on when the referenced service is not active (due to profiles in my case) has changed. It used to ignore the missing service but now with the latest compose it is an error if the referenced service is not active. But, I noticed the new "required" property to enable the previous behavior. However, this property is causing Additional property required is not allowed

Steps To Reproduce

  1. Environment:
    Ubuntu 22.04 with Docker installed from Docker repositories.
    Docker Compose version v2.19.1
    Docker version 24.0.4, build 3713ee1

  2. With example compose.yaml:

services:
  first:
    image: hello-world

  second:
    image: hello-world
    depends_on:
      first:
        condition: service_completed_successfully
        required: false
  1. Run:
    09:40 $ docker compose up

  2. Error:
    validating /home/essaids/git/gh/se/hapi-server-setup/tmp/dc1/compose.yaml: services.second.depends_on.first Additional property required is not allowed

Compose Version

Docker Compose version v2.19.1
Docker version 24.0.4, build 3713ee1

Docker Environment

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

Server:
 Containers: 8
  Running: 1
  Paused: 0
  Stopped: 7
 Images: 77
 Server Version: 24.0.4
 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 logentries splunk syslog
 Swarm: inactive
 Runtimes: io.containerd.runc.v2 runc
 Default Runtime: runc
 Init Binary: docker-init
 containerd version: 3dce8eb055cbb6872793272b4f20ed16117344f8
 runc version: v1.1.7-0-g860f061
 init version: de40ad0
 Security Options:
  apparmor
  seccomp
   Profile: builtin
  cgroupns
 Kernel Version: 5.19.0-46-generic
 Operating System: Ubuntu 22.04.2 LTS
 OSType: linux
 Architecture: x86_64
 CPUs: 6
 Total Memory: 73.4GiB
 Name: WVM4
 ID: e82f8658-d07f-477c-ab34-a5f152ef9e34
 Docker Root Dir: /var/lib/docker
 Debug Mode: false
 Experimental: false
 Insecure Registries:
  127.0.0.0/8
 Live Restore Enabled: false

Anything else?

No response

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions