Skip to content

Conversation

@Pnkcaht
Copy link

@Pnkcaht Pnkcaht commented Jan 15, 2026

What I did

Added a warning when unsupported Compose attributes are detected during project
loading. Currently this warns when the deploy section is used, which is
ignored by docker compose outside of Swarm mode.

This avoids silent misconfiguration and makes it clear to users why deploy
settings are not applied when running docker compose outside of Swarm mode.

Related issue

Fixes #13150
Related to #13149

(not mandatory) A picture of a cute animal, if possible in relation to what you did

🐶 A vigilant watchdog barking loudly when something unsupported sneaks in — just like Compose now warns users when deploy is defined outside of Swarm mode.

Notes

  • Emits a warning when the deploy attribute is present in a service definition
  • Does not change runtime behavior; only adds user-facing feedback
  • Keeps backward compatibility
  • Introduces a small, dedicated warnings.go helper to keep the logic isolated
  • Verified with local build and tests:
    • go build ./cmd/compose
    • go test ./cmd/compose/...

Screenshot

Build and tests passing locally

image

@Pnkcaht Pnkcaht requested a review from a team as a code owner January 15, 2026 02:00
@Pnkcaht Pnkcaht requested review from glours and ndeloof January 15, 2026 02:00
Signed-off-by: pnkcaht <samzoovsk19@gmail.com>
for _, service := range project.Services {
if service.Deploy != nil {
logrus.Warnf(
"Service %q uses 'deploy' which is not supported by docker compose and will be ignored",
Copy link
Contributor

Choose a reason for hiding this comment

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

that's wrong. most of deploy section is ignored by compose, but some attributes are considered. Typically replica and some device requests (used for gpu support)

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.

[BUG] Compose don't warn user for unsupported attributes

2 participants