-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cli/compose/schema: make version: "3" equivalent to "3.x" (latest) #3445
Conversation
/cc @ndeloof @ulyssessouza ptal |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+10000000
Oh! One test failing; I probably forgot to update one (it's been a while since I made this patch)
|
Previously, `version: "3"` was equivalent to `version: "3.0"`, which caused confusion for many users, as they expected it to be "3.x". docker-compose and docker compose (v2) have adopted the compose-spec (https://compose-spec.io), which no longer has a version field in the compose file, and always picks the "latest" supported version. This changes how `docker stack` interprets "major" version numbers specified in compose-files: When only the major version ("3") is specified, it is now equivalent to "3.x" (latest supported v3 schema). Compose-files that specify both major and minor version (e.g. "3.0" or "3.1") continue to use the existing behavior; validation is down- graded to the specified version and will produce an error if options are used that are not supported in that schema version. This allows users to locally verify that a composse-file does not use options that are not supported in the intended deployment environment (for example if the deploy environment only supports older versions of the schema). Signed-off-by: Sebastiaan van Stijn <[email protected]>
85ebdc1
to
60c3836
Compare
@@ -180,7 +180,7 @@ func strPtr(val string) *string { | |||
} | |||
|
|||
var sampleConfig = types.Config{ | |||
Version: "3.0", | |||
Version: "3.10", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was the config I forgot to update that made the test fail; all green now
Let's get this one in 👍 |
follow-up to #3257
Previously,
version: "3"
was equivalent toversion: "3.0"
, whichcaused confusion for many users, as they expected it to be "3.x".
docker-compose and docker compose (v2) have adopted the compose-spec
(https://compose-spec.io), which no longer has a version field in
the compose file, and always picks the "latest" supported version.
This changes how
docker stack
interprets "major" version numbersspecified in compose-files:
When only the major version ("3") is specified, it is now equivalent
to "3.x" (latest supported v3 schema).
Compose-files that specify both major and minor version (e.g. "3.0"
or "3.1") continue to use the existing behavior; validation is down-
graded to the specified version and will produce an error if options
are used that are not supported in that schema version. This allows
users to locally verify that a composse-file does not use options
that are not supported in the intended deployment environment (for
example if the deploy environment only supports older versions of
the schema).
- Description for the changelog
- A picture of a cute animal (not mandatory but encouraged)