-
Notifications
You must be signed in to change notification settings - Fork 34
Migrate to compose_spec
#73
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
Merged
Merged
Conversation
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
Signed-off-by: Paul Nettleton <k9@k9withabone.dev>
Added `compose_spec` dependency, temporarily using the git repository. Also updated some error messages and error docs for `cli::compose::from_file_or_stdin()`, `cli::compose::from_stdin()`, and `cli::Commands::try_into_files()`. Signed-off-by: Paul Nettleton <k9@k9withabone.dev>
Required for converting `compose_spec::service::Dependency`. Signed-off-by: Paul Nettleton <k9@k9withabone.dev>
Check each field instead of comparing to the default. Signed-off-by: Paul Nettleton <k9@k9withabone.dev>
Changed `cli::Commands::try_into_files()` to use `compose_spec::Compose` for conversion to `quadlet::File`s. Now rejects `include` and `configs`, and requires `secrets` to be external. Changed `cli::compose::try_into_quadlet_files()` to use `compose_spec::Compose` and added error docs. `cli::compose::services()` was removed as it is no longer needed. Changed `cli::compose::service_try_into_quadlet_file()` to use `compose_spec::Service` and added more docs. Instead of going through `cli::PodmanCommands`, the service is converted into a `cli::Container` directly and then into a `quadlet::Container`. The `cli::Service` is created from the `compose_spec::service::Restart`. Removed `cli::ComposeService` as `.volume` is now added to the `quadlet::container::volume::Source::NamedVolume` after the `compose_spec::Service` is converted into a `quadlet::Container` in `cli::compose::service_try_into_quadlet_file()`. Changed `cli::Unit::add_dependencies()` to `add_dependency()` which now takes a dependency name `compose_spec::Identifier` and a `compose_spec::service::Dependency` from `compose_spec::Service`'s `depends_on` field. It also errors if the `Dependency` is not compatible with quadlet. Changed `cli::compose::networks_try_into_quadlet_files()` to use `compose_spec::Networks` and added error docs. Changed `cli::compose::volumes_try_into_quadlet_files()` to use `compose_spec::Volumes` and added more docs. Added docs to `cli::Container::name()`. Signed-off-by: Paul Nettleton <k9@k9withabone.dev>
Signed-off-by: Paul Nettleton <k9@k9withabone.dev>
First, a `cli::GlobalArgs` is created by taking the `runtime` and `storage_opt` fields from the `compose_spec::Service`. Next, that is converted to a `quadlet::Globals` which is used in the generated `quadlet::File`. Signed-off-by: Paul Nettleton <k9@k9withabone.dev>
…ice` Split up `compose_spec::Service` into separate parts in `cli::container::compose`. Allows for destructuring, ensuring all fields of `compose_spec::Service` are considered for conversion. Also, no more `TryFrom<&mut ComposeService>`, yay! Signed-off-by: Paul Nettleton <k9@k9withabone.dev>
Signed-off-by: Paul Nettleton <k9@k9withabone.dev>
Signed-off-by: Paul Nettleton <k9@k9withabone.dev>
Signed-off-by: Paul Nettleton <k9@k9withabone.dev>
Completes the creation of `cli::Container` from `compose_spec::Service`. Signed-off-by: Paul Nettleton <k9@k9withabone.dev>
Also changed `options` field of `quadlet::Network` to a `Vec<String>`. Signed-off-by: Paul Nettleton <k9@k9withabone.dev>
Signed-off-by: Paul Nettleton <k9@k9withabone.dev>
`podlet compose --pod <POD>` is now `podlet compose --kube`. The `name` field of a compose file is required when using `--kube`. It is used as the name of the pod and in the filenames of the generated `.kube` quadlet file and Kubernetes YAML file. Frees `podlet compose --pod` for creating a `.pod` quadlet file from a compose file in the future. Signed-off-by: Paul Nettleton <k9@k9withabone.dev>
`cli::File::KubePod { .. }` changed to
`cli::File::Kubernetes(cli::k8s::File)`.
`cli::k8s::File` created from `compose_spec::Compose`.
Signed-off-by: Paul Nettleton <k9@k9withabone.dev>
All usages were replaced with `compose_spec::duration`. Signed-off-by: Paul Nettleton <k9@k9withabone.dev>
Signed-off-by: Paul Nettleton <k9@k9withabone.dev>
Signed-off-by: Paul Nettleton <k9@k9withabone.dev>
3ac81fc to
d47d6e3
Compare
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.
Changes the library used for deserializing a compose file from
docker-compose-typestocompose_spec. Most of the conversion logic was refactored/rewritten and hopefully readability and maintainability have improved in those areas.compose_specis a lot stricter about what it accepts as a valid compose file. This is a breaking change as some compose files (those that don't comply with the spec) will no longer successfully deserialize and convert.A new
--binds-tooption was added, which setsBindsTo=in the[Unit]section. It was needed for converting from long syntaxdepends_onwhenrestartistrue.One other breaking change is that
podlet compose --podwas renamed topodlet compose --kubeand no longer takes an argument. Instead, podlet uses the top-levelnamefield from the compose file for the name of pod.--podwill return with Podman v5.0.0 support (#68).Closes #47
Closes #61
Closes #62
Closes #63
Closes #69