Skip to content

feat(compose): expose supported port placement choices - #233

Open
x3ccd4828 wants to merge 2 commits into
containers:mainfrom
x3ccd4828:fix/compose-port-placement
Open

x3ccd4828 wants to merge 2 commits into
containers:mainfrom
x3ccd4828:fix/compose-port-placement

Conversation

@x3ccd4828

Copy link
Copy Markdown
Contributor

Summary

  • Add compose --port-placement=pod|container so the existing port placement choice can be made explicit without changing defaults.
  • Reject --pod --port-placement=container with an actionable error. Podman requires ports of containers in a pod to be published by the pod, so generating container-level PublishPort= alongside Pod= would produce an unsupported configuration.
  • Document the supported alternative, podlet compose --port-placement=container, which generates separate container Quadlets with each service's ports preserved.
  • Add regression coverage for short and long Compose port syntax, host IP bindings, UDP, defaults, and invalid combinations.

Validation

  • cargo test
  • cargo fmt --check
  • cargo clippy

Closes #225

Allow users to select the existing pod or container port placement explicitly. Reject container publishing with --pod because Podman requires pod-level publishing, and document the supported standalone-container workflow.

Closes: containers#225
Signed-off-by: Cristian Filipescu <filipescu.cristian@gmail.com>
Rust 1.99 warns when the color-eyre bail macro is used as a match expression, and CI promotes that warning to an error. Use statement-position invocations for all affected match arms.

Signed-off-by: Cristian Filipescu <filipescu.cristian@gmail.com>
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.

compose --pod: add an opt-in mode to preserve service-level port mappings

1 participant