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

feat: set compatibility with --podman-version #46

Merged
merged 2 commits into from
Jan 4, 2024
Merged

feat: set compatibility with --podman-version #46

merged 2 commits into from
Jan 4, 2024

Conversation

k9withabone
Copy link
Member

Closes #45

Setting a lower podman version will downgrade generated quadlets compatibility. Will return an error if an incompatible quadlet option is used.

Implemented as an in-place, one-way transformation of quadlet::File and its parts. That way, there is less complexity than dealing with multiple versions of each quadlet resource type.

--podman-version has aliases --compatibility and --compat.

Setting a lower podman version will downgrade the quadlet's
compatibility. Will return an error if an incompatible quadlet option is
used.

Implemented as an in-place, one-way transformation of `quadlet::File`
and its parts. That way, there is less complexity than dealing with
multiple versions of each quadlet resource type.

`--podman-version` has aliases `--compatibility` and `--compat`.

Also enabled `wrap_help` feature of clap.

Closes: #45
Serializing maps to args is not needed. The removal allows for
eliminating a box allocation for each flag and making the arg serializer
simpler and more similar to the quadlet serializer.

Also removed the `skip_serializing_if`s from `PodmanArgs` structs (since
serializing empty `Vec`s or `Option`s no longer incurs an allocation)
to reduce code generation and if checks.
@k9withabone k9withabone added the enhancement New feature or request label Jan 3, 2024
@k9withabone k9withabone added this to the v0.2.4 milestone Jan 3, 2024
@k9withabone
Copy link
Member Author

@cyqsimon, can you test this out and see if it fits with what you wanted?

@cyqsimon
Copy link

cyqsimon commented Jan 4, 2024

I tested on a few different compose files and it's looking great. The code looks pretty much like what I imagined too. I have no complaints whatsoever.

Thank you so much for swiftly taking on the feature request!

@k9withabone k9withabone merged commit 2af24b3 into main Jan 4, 2024
9 checks passed
@k9withabone k9withabone deleted the compat branch January 4, 2024 06:31
@cyqsimon
Copy link

cyqsimon commented Jan 4, 2024

Oh yes. I noticed that you probably want to update README, in particular the FEATURES and CAUTIONS sections.

@k9withabone
Copy link
Member Author

Will do when I'm getting ready to release the next podlet version.

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

Successfully merging this pull request may close these issues.

[Feat. Req.] Add option to support older podman versions?
2 participants