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

Use compose-go to load and parse compose file #5657

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

szobov
Copy link

@szobov szobov commented Nov 29, 2024

- What I did

As we discussed with @glours in Slack, I took his branch, rebased it on the resent main branch, updated compose-go to the recent version and fixed all incompatibility issues.

If this work gets some attention from maintainers, I'll call for testing in the related issue and in the Slack group to get volunteers to test these changes.

❗ everything you will read below is a verbatim copy of @glours PR's description since this PR is based on his work ❗

Use compose-go to parse, interpolate and merge Compose configurations.
As this library, under active maintenance and development by the Compose team, is up to date with the recent evolutions of the Compose Specification it will remove the potential divergence between the 2 code base, make the maintenance and evolution easier for everyone.
As a side effect, it would remove the necessity of using the version attribute. It disturbs users, the official Docker message is: "You don't need the version attribute anymore in your Compose files" and the CLI continue to introduce new versions of compose v3 file format

- How I did it

Import the compose-go library, removed the duplicated code for structs, keep only the specific checks done on forbidden, unsupported and deprecated properties on the parsing part.
Remove the interpolation and merging functions and let compose-go doing the job
Add the specific mapping for x-cluster-spec extension attribut to match the ClusterVolumeSpec struct
Remove all the duplicated tests already done on the compose-go side

- How to verify it

Run tests
Use average Compose configurations and check we're still producing the same output than the current version

- Description for the changelog

Use [compose-go](https://github.com/compose-spec/compose-go) to manage Compose configuration files

@szobov szobov requested review from silvin-lubecki and a team as code owners November 29, 2024 13:50
@szobov
Copy link
Author

szobov commented Dec 16, 2024

Hey there,
I'm sorry to bother you folks, but I wanted to say that this PR touching many parts of the code and rebasing it to master is quite a pain.
If you could spend some time reviewing it, I would highly appreciate it. 🙏

Also, these changes were needed for a long while, and they were implemented almost a year ago but still haven't been merged.
I understand that it's a heavy burden to review it, but if you can at least give me some guidance on what needs to be done to merge it, that would be amazing.
Thanks in advance! <3
cc @thaJeztah @silvin-lubecki

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

Successfully merging this pull request may close these issues.

2 participants