Skip to content

Add missing fields to NetworkEntry #254

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 2 commits into from
Apr 9, 2021
Merged

Add missing fields to NetworkEntry #254

merged 2 commits into from
Apr 9, 2021

Conversation

vv9k
Copy link
Contributor

@vv9k vv9k commented Feb 6, 2021

What did you implement:

Added missing fields to NetEntry, namely Links, Aliases and IPAMConfig.

Closes: #227

How did you verify your change:

Tested locally and got expected results:

❯ cargo run --example containerinspect -- f74a8ceb19a9
    Blocking waiting for file lock on build directory
   Compiling shiplift v0.7.0 (/home/wojtek/dev/shiplift)
    Finished dev [unoptimized + debuginfo] target(s) in 5.42s
     Running `target/debug/examples/containerinspect f74a8ceb19a9`
ContainerDetails {
    app_armor_profile: "",
    args: [
        "10000",
    ],
    config: Config {
        attach_stderr: true,
        attach_stdin: true,
        attach_stdout: true,
        cmd: Some(
            [
                "sleep",
                "10000",
            ],
        ),
        domainname: "",
        entrypoint: None,
        env: Some(
            [
                "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
            ],
        ),
        exposed_ports: None,
        hostname: "f74a8ceb19a9",
...
    network_settings: NetworkSettings {
        bridge: "",
        gateway: "",
        ip_address: "",
        ip_prefix_len: 0,
        mac_address: "",
        ports: Some(
            {},
        ),
        networks: {
            "shiplift_netnet": NetworkEntry {
                network_id: "7640c010a6863daa4efe9ad43f3158a0129264d9fac80a0c731b8ed36b071b23",
                endpoint_id: "59920e3c8efcb2994f3870b74df199a17c4b0edcf6158d46e7a07754df62bc7b",
                gateway: "172.19.0.1",
                ip_address: "172.19.0.3",
                ip_prefix_len: 16,
                ipv6_gateway: "",
                global_ipv6_address: "",
                global_ipv6_prefix_len: 0,
                mac_address: "02:42:ac:13:00:03",
                links: None,
                aliases: Some(
                    [
                        "f74a8ceb19a9",
                    ],
                ),
                ipam_config: None,
            },
        },
    },

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

NetworkEntry now contains extra fields: links, addresses, ipam_config

@vv9k vv9k changed the title Net entry Add missing fields to NetworkEntry Feb 6, 2021
Copy link
Contributor

@elihunter173 elihunter173 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me

@vv9k
Copy link
Contributor Author

vv9k commented Mar 11, 2021

Rebased to current master, if there are no suggestions it's ready to get merged.

Copy link
Collaborator

@matthiasbeyer matthiasbeyer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good.

@matthiasbeyer matthiasbeyer merged commit d6bf9d4 into softprops:master Apr 9, 2021
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.

Get network alias of running container
3 participants