Skip to content

warn about deploy attributes ignored in standalone mode - #14192

Open
veerareddyvishal144 wants to merge 1 commit into
docker:mainfrom
veerareddyvishal144:fix/warn-ignored-deploy-13150
Open

warn about deploy attributes ignored in standalone mode#14192
veerareddyvishal144 wants to merge 1 commit into
docker:mainfrom
veerareddyvishal144:fix/warn-ignored-deploy-13150

Conversation

@veerareddyvishal144

Copy link
Copy Markdown

Fixes #13150

Compose silently ignores several deploy sub-attributes outside Swarm mode (e.g. a service with deploy.update_config behaves as if it wasn't set). Per the Compose spec the runtime should warn about unsupported attributes.

Change

  • New cmd/compose/warnings.go: after the project model loads (ProjectOptions.ToProject), emit one warning per service listing the ignored deploy attributes it sets: placement.constraints, placement.preferences, update_config, rollback_config, endpoint_mode, mode. Attributes that are still honored (replicas, device reservations, restart_policy fallback) are deliberately excluded.
  • Unit tests for the collector (nil/empty/supported-only/ignored).

Verification

  • go test ./cmd/compose/ passes (incl. new tests); golangci-lint 0 issues; gofmt clean.
  • End-to-end with a locally built binary: a service with update_config + placement.constraints prints Service "web" uses deploy attributes that are ignored by Compose in standalone mode: placement.constraints, update_config on stderr; a replicas-only service stays silent.

Signed-off-by: vishal veerareddy <vishalveera.reddy@servicenow.com>
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

1 participant