fix(compose): support explicit network names - #223
Open
x3ccd4828 wants to merge 3 commits into
Open
Conversation
x3ccd4828
force-pushed
the
fix/compose-network-name
branch
2 times, most recently
from
July 28, 2026 19:56
1d1df01 to
ea2a9f9
Compare
x3ccd4828
marked this pull request as ready for review
July 28, 2026 19:57
Signed-off-by: Cristian Filipescu <filipescu.cristian@gmail.com>
x3ccd4828
force-pushed
the
fix/compose-network-name
branch
from
July 28, 2026 19:59
ea2a9f9 to
a621d55
Compare
Member
|
Thanks for submitting a PR! Sorry for not getting to this sooner. |
k9withabone
requested changes
Sep 1, 2026
k9withabone
left a comment
Member
There was a problem hiding this comment.
Other than a couple nitpicks, this looks good!
Comment on lines
+57
to
+59
| /// Override the name of the Podman network created by this Quadlet. | ||
| #[serde(rename = "NetworkName")] | ||
| pub name: Option<String>, |
Member
There was a problem hiding this comment.
This field should be named network_name instead of using the #[serde(rename = "NetworkName"] attribute. I try to reserve the attribute for when it can't be avoided such as for one-off case conversions.
Comment on lines
80
to
92
| impl Downgrade for Network { | ||
| fn downgrade(&mut self, version: PodmanVersion) -> Result<(), DowngradeError> { | ||
| if version < PodmanVersion::V5_6 { | ||
| if let Some(interface_name) = self.interface_name.take() { | ||
| self.push_arg("interface-name", &interface_name); | ||
| } | ||
| } | ||
|
|
||
| if version < PodmanVersion::V4_7 { | ||
| for dns in std::mem::take(&mut self.dns) { | ||
| self.push_arg("dns", &dns); | ||
| } | ||
| } |
Member
There was a problem hiding this comment.
You need to add the new field to the Downgrade impl. Looking at old versions of the Quadlet documentation, it looks like NetworkName= was added in Podman v4.7.0.
|
@k9withabone i want to add more PRs what is the best way to get these reviewed and merged quickly? |
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
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.
Summary
namefield on top-level network definitionsNetworkName=in the generated Quadlet network unitWhy
Compose allows a network resource key and the created network's name to differ:
Podlet 0.3.2 currently rejects this input because the Quadlet network conversion classifies
nameas unsupported. Mapping it toNetworkName=preserves the resource key for the generatedbackend.networkfile and its container references while creating the Podman network with the requested explicit name.This implements the behavior described in #21.
Validation
cargo fmt --verbose --checkcargo clippy -- -Dwarningscargo test --verbose(78 passed)Network=backend.networkandNetworkName=explicit-network-name