compose/pkg/api
Nicolas De Loof bd07e0b4c0 feat(api): reject an unknown recreate policy instead of treating it as diverged
CreateOptions.Recreate and RecreateDependencies are strings, and any value
other than force or never silently behaved like diverged: a typo such as
"forced" was accepted and did the opposite of what the caller meant.

Add CreateOptions.Validate, which rejects such values with an
InvalidOptionError matching the new ErrInvalidOption, and call it from
Create and, through UpOptions.Validate, from Up, before anything is
touched. The empty string keeps meaning diverged, and the Recreate*
constants are unchanged, so existing callers are not affected.

Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2026-11-16 17:01:39 +01:00
..
api.go feat(api): reject an unknown recreate policy instead of treating it as diverged 2026-11-16 17:01:39 +01:00
api_test.go build(deps): adopt compose-go jobs and the container-spec layering 2026-09-21 16:35:20 +02:00
context.go Introduce abstractions to support SDK usage without requiring Docker CLI 2025-10-27 16:17:50 +01:00
create_options.go feat(api): reject an unknown recreate policy instead of treating it as diverged 2026-11-16 17:01:39 +01:00
create_options_test.go feat(api): reject an unknown recreate policy instead of treating it as diverged 2026-11-16 17:01:39 +01:00
doc.go feat(api): reject an unknown recreate policy instead of treating it as diverged 2026-11-16 17:01:39 +01:00
env.go restore support for COMPOSE_COMPATIBILITY 2025-12-07 18:42:04 +01:00
errors.go feat(api): reject an unknown recreate policy instead of treating it as diverged 2026-11-16 17:01:39 +01:00
errors_test.go deps: remove deprecated github.com/pkg/errors 2023-09-29 06:28:58 +02:00
event.go docs(api): state that EventProcessor.Done reports cancellation as failure 2026-11-16 14:34:24 +01:00
feature.go refactor(up): inject the navigation menu instead of importing cmd/formatter 2026-10-12 10:50:38 +02:00
labels.go docs(compose): state that a relay-only endpoint also needs an interface-pinned bind 2026-10-02 12:33:26 +02:00
labels_test.go golangci-lint: use gci formatter instead of goimports 2025-12-01 12:21:50 +01:00
up_options.go feat(api): reject an unknown recreate policy instead of treating it as diverged 2026-11-16 17:01:39 +01:00
up_options_test.go api: reject incompatible Up options with a typed error 2026-10-26 14:49:08 +01:00