Skip to content

Add missing fields to NetworkEntry - #254

Merged
matthiasbeyer merged 2 commits into
softprops:masterfrom
vv9k:net_entry
Apr 9, 2021
Merged

Add missing fields to NetworkEntry#254
matthiasbeyer merged 2 commits into
softprops:masterfrom
vv9k:net_entry

Conversation

@vv9k

@vv9k vv9k commented Feb 6, 2021

Copy link
Copy Markdown
Contributor

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

@elihunter173 elihunter173 left a comment

Copy link
Copy Markdown
Contributor

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

vv9k commented Mar 11, 2021

Copy link
Copy Markdown
Contributor Author

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

@matthiasbeyer matthiasbeyer left a comment

Copy link
Copy Markdown
Collaborator

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