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
@Pnkcaht Pnkcaht force-pushed the feat/warn-unsupported-attributes branch from 361da93 to 02186fb Compare January 15, 2026 02:01
@Pnkcaht Pnkcaht force-pushed the feat/warn-unsupported-attributes branch from 02186fb to b97b147 Compare January 18, 2026 15:26
@Pnkcaht
Copy link
Author

Pnkcaht commented Jan 18, 2026

Summary

@ndeloof
Add a targeted warning for deploy attributes that are consistently ignored by Docker Compose in standalone mode.

Details

  • Detects ignored deploy subfields (placement, update/rollback config, endpoint mode, mode)

  • Avoids struct comparison issues by checking meaningful subfields only

  • Explicitly excludes supported or fallback attributes (replicas, device reservations, restart_policy)

  • Emits a single, clear warning per service with a sorted attribute list

Impact

  • Improves user feedback and clarity

  • No behavior or runtime changes

  • Warning-only, non-breaking improvement

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