Skip to content
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: add schema 3.10, with optional version field (default to "latest") #3257

Merged
merged 3 commits into from
Feb 25, 2022

Conversation

thaJeztah
Copy link
Member

@thaJeztah thaJeztah commented Aug 16, 2021

The compose spec (https://compose-spec.io) defines the version to be optional,
and implementations of the spec to check for supported attributes instead.

While this change does not switch the docker stack implementation to use the
compose-spec, it makes it function more similar. Previously, omitting a version
number would either produce an error (as the field was required), or switched
the handling to assume it was version 1.0 (which is deprecated).

With this change, compose files without a version number will be handled as
the latest version supported by docker stack (currently 3.10). This allows
users that work with docker-compose or docker compose (v2) to deploy their
compose file, without having to re-add a version number. Fields that are
not supported by docker stack (schema 3.10) will still produce an error.

- Description for the changelog

- A picture of a cute animal (not mandatory but encouraged)

@thaJeztah

This comment has been minimized.

@thaJeztah thaJeztah marked this pull request as draft August 16, 2021 13:06
@thaJeztah thaJeztah force-pushed the compose_remove_required_version branch from b84b7c1 to 297230b Compare August 16, 2021 13:16
@thaJeztah thaJeztah marked this pull request as ready for review August 16, 2021 13:30
@thaJeztah
Copy link
Member Author

@thaJeztah
Copy link
Member Author

Easiest to review per commit; the "main" bits are in the last commit

Copy link
Member

@StefanScherer StefanScherer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense!
LGTM

Adding a copy of the 3.9 schema, with only the version-string changed.
This makes it easier to find changes since 3.9, which are added after
this.

Signed-off-by: Sebastiaan van Stijn <[email protected]>
The compose spec (https://compose-spec.io) defines the version to be optional,
and implementations of the spec to check for supported attributes instead.

While this change does not switch the `docker stack` implementation to use the
compose-spec, it makes it function more similar. Previously, omitting a version
number would either produce an error (as the field was required), or switched
the handling to assume it was version 1.0 (which is deprecated).

With this change, compose files without a version number will be handled as
the latest version supported by `docker stack` (currently 3.10). This allows
users that work with docker-compose or docker compose (v2) to deploy their
compose file, without having to re-add a version number. Fields that are
not supported by stackes (schema 3.10) will still produce an error.

Signed-off-by: Sebastiaan van Stijn <[email protected]>
@thaJeztah thaJeztah force-pushed the compose_remove_required_version branch from 297230b to a777880 Compare February 18, 2022 11:26
@thaJeztah
Copy link
Member Author

Rebased to get a fresh run of CI

@thaJeztah
Copy link
Member Author

let's bring this in

I think I had a follow-up stashed somewhere as well; will dig it up and open a PR for that

@thaJeztah thaJeztah merged commit 6c75b75 into docker:master Feb 25, 2022
@thaJeztah thaJeztah deleted the compose_remove_required_version branch February 25, 2022 18:47
@smidge84
Copy link

@thaJeztah
Thanks for completing this change. I'm just not familiar with your release process.
Now that the work is in "master", when will this make it into a release of the package?
Is this what the milestone 21.xx is about?

@thaJeztah
Copy link
Member Author

Is this what the milestone 21.xx is about?

Yes, that's correct; plan is to do a release next month (if all goes well 👍)

@trajano
Copy link
Contributor

trajano commented Aug 20, 2022

Is this not merged into Docker Desktop yet?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants