Skip to content

add required attribute depends_on#382

Merged
ndeloof merged 1 commit intocompose-spec:masterfrom
glours:depends_on-required-attribut
Jul 6, 2023
Merged

add required attribute depends_on#382
ndeloof merged 1 commit intocompose-spec:masterfrom
glours:depends_on-required-attribut

Conversation

@glours
Copy link
Copy Markdown
Contributor

@glours glours commented Jul 4, 2023

What this PR does / why we need it:
Introduce a required attribut to depends_on to allow a Compose implementation to only warn user when a dependency service isn't started or available.

Why this change?
Since the beginning the reference implementation Docker Compose was silently ignore missing dependency services, recently a fix was introduced to strictly follow the specification and broke existing users Compose configurations.
Adding this new attribute will let them continue to use the previous behaviour while making clear and explicit the depends_on could be bypass by the Compose implementation

Which issue(s) this PR fixes:

Fixes #274

@glours glours self-assigned this Jul 4, 2023
@glours glours force-pushed the depends_on-required-attribut branch from 3b052dd to b6dd189 Compare July 4, 2023 13:22
Comment thread 05-services.md Outdated
@glours glours force-pushed the depends_on-required-attribut branch 2 times, most recently from 0539ac1 to db30100 Compare July 4, 2023 15:48
Copy link
Copy Markdown
Member

@laurazard laurazard left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Just left a nit.

Comment thread 05-services.md
service.
- `service_completed_successfully`: specifies that a dependency is expected to run
to successful completion before starting a dependent service.
- `required`: when `false` Compose only warns you when the dependency service isn't started or available. If not defined
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: maybe an empty line such as in 374 to separate the new field description more from the rest?

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Allow depends_on to be optional to use profiles to control which services to run in development vs production

3 participants