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

Add portmappings to ContainerCreateOptsBuilder #117

Merged
merged 2 commits into from
Apr 18, 2022

Conversation

marhkb
Copy link
Contributor

@marhkb marhkb commented Apr 14, 2022

What did you implement:

While working on this PR I saw that there is a TODO for portmappings in ContainerCreateOptsBuilder, which I need. Thus, I implemented it.

How did you verify your change

I tested this within the PR.

Bildschirmfoto von 2022-04-14 23-18-19

The code I use is basically:

//...
.portmappings(
    imp.port_mappings
        .borrow()
        .to_owned()
        .to_typed_list_model::<model::PortMapping>()
        .into_iter()
        .map(|port_mapping| api::PortMapping {
            container_port: Some(port_mapping.container_port() as i64),
            host_ip: None,
            host_port: Some(port_mapping.host_port() as i64),
            protocol: Some(port_mapping.protocol().to_string()),
            range: None,
        }),
)
//...

The portmappings are accepted and are shown in cockpit.

Bildschirmfoto von 2022-04-14 23-18-31

What (if anything) would need to be called out in the CHANGELOG for the next release

Probably the titles of both commits would fit here.

In this way, things like `portmappings` can be implemented in
`ContainerCreateOptsBuilder`.
@marhkb marhkb changed the title Container create opts builder portmappings Add portmappings to ContainerCreateOptsBuilder Apr 14, 2022
@marhkb marhkb changed the title Add portmappings to ContainerCreateOptsBuilder Add portmappings to ContainerCreateOptsBuilder Apr 14, 2022
@vv9k
Copy link
Owner

vv9k commented Apr 18, 2022

Looks good to me! Thank you :)

@vv9k vv9k merged commit 66ff556 into vv9k:master Apr 18, 2022
@marhkb marhkb deleted the container-create-opts-builder-portmappings branch April 18, 2022 20:32
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