⚠️ Breaking change (Go API)
types.ServiceConfig now embeds types.ContainerSpec and types.WorkloadSpec, shared with the new jobs element and pre_start init containers. Field access is unchanged (svc.Image), but struct literals must now set moved fields through the embedded structs, and code walking ServiceConfig with reflection will see these two embedded structs instead of a flat list of fields:
types.ServiceConfig{Name: "web", ContainerSpec: types.ContainerSpec{Image: "nginx"}}ServiceConfig.PreStart is now a []types.PreStartHook (was []types.ServiceHook), which embeds a full ContainerSpec; Image and PerReplica are no longer fields of ServiceHook.
The order of keys in the YAML and JSON produced for a service also changes (service-level keys first, then container-level, then workload-level ones). The content is the same, but expected files compared as text need to be regenerated.
What's Changed
- loader: detect unsupported compose-file attributes by @glours in https://github.com/compose-spec/compose-go/pull/927
- fix(transform): honor ignoreParseError in ssh and ulimits parsers by @glours in https://github.com/compose-spec/compose-go/pull/928
- Jobs by @ndeloof in https://github.com/compose-spec/compose-go/pull/866
- fix: type=image volume source is always a docker image reference by @ndeloof in https://github.com/compose-spec/compose-go/pull/929
- fix: an explicit working dir must survive a remote resource loader by @ndeloof in https://github.com/compose-spec/compose-go/pull/930
- fix: reject non-mapping entries under networks and models by @glours in https://github.com/compose-spec/compose-go/pull/932
- fix: allow disabled services as build additional contexts by @Shubham-Padkonde in https://github.com/compose-spec/compose-go/pull/931
- loader: promote x-* extensions adopted by the specification by @ndeloof in https://github.com/compose-spec/compose-go/pull/935
New Contributors
- @Shubham-Padkonde made their first contribution in https://github.com/compose-spec/compose-go/pull/931
Full Changelog: https://github.com/compose-spec/compose-go/compare/v2.15.0...v2.16.0