cli/compose/schema: make version: "3" equivalent to "3.x" (latest)#3445
Merged
thaJeztah merged 1 commit intodocker:masterfrom Mar 1, 2022
Merged
cli/compose/schema: make version: "3" equivalent to "3.x" (latest)#3445thaJeztah merged 1 commit intodocker:masterfrom
thaJeztah merged 1 commit intodocker:masterfrom
Conversation
Member
Author
|
/cc @ndeloof @ulyssessouza ptal |
Member
Author
|
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 <github@gone.nl>
85ebdc1 to
60c3836
Compare
thaJeztah
commented
Mar 1, 2022
|
|
||
| var sampleConfig = types.Config{ | ||
| Version: "3.0", | ||
| Version: "3.10", |
Member
Author
There was a problem hiding this comment.
This was the config I forgot to update that made the test fail; all green now
Member
Author
|
Let's get this one in 👍 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 stackinterprets "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)