Skip to content

Fix incorrect aux-address examples and test#26931

Merged
mdlinville merged 1 commit intomoby:masterfrom
thaJeztah:fix-aux-address-example
Sep 28, 2016
Merged

Fix incorrect aux-address examples and test#26931
mdlinville merged 1 commit intomoby:masterfrom
thaJeztah:fix-aux-address-example

Conversation

@thaJeztah
Copy link
Copy Markdown
Member

@thaJeztah thaJeztah commented Sep 26, 2016

The (host)name for aux-addresses should
be unique, otherwise later values overwrite
earlier values.

Before this change, the example command
would send this API request;

{
  "Attachable": false,
  "CheckDuplicate": true,
  "Driver": "overlay",
  "EnableIPv6": false,
  "IPAM": {
    "Config": [
      {
        "Gateway": "192.168.0.100",
        "IPRange": "192.168.1.0/24",
        "Subnet": "192.168.0.0/16"
      },
      {
        "AuxiliaryAddresses": {
          "c": "192.170.1.5",
          "d": "192.170.1.6"
        },
        "Gateway": "192.170.0.100",
        "Subnet": "192.170.0.0/16"
      }
    ],
    "Driver": "default",
    "Options": {}
  },
  "Internal": false,
  "Labels": {},
  "Name": "my-multihost-network",
  "Options": {}
}

After this change, the request looks
like this (all aux-addresses preserved);

{
  "Attachable": false,
  "CheckDuplicate": true,
  "Driver": "overlay",
  "EnableIPv6": false,
  "IPAM": {
    "Config": [
      {
        "AuxiliaryAddresses": {
          "my-router": "192.168.1.5",
          "my-switch": "192.168.1.6"
        },
        "Gateway": "192.168.0.100",
        "IPRange": "192.168.1.0/24",
        "Subnet": "192.168.0.0/16"
      },
      {
        "AuxiliaryAddresses": {
          "my-printer": "192.170.1.5",
          "my-nas": "192.170.1.6"
        },
        "Gateway": "192.170.0.100",
        "Subnet": "192.170.0.0/16"
      }
    ],
    "Driver": "default",
    "Options": {}
  },
  "Internal": false,
  "Labels": {},
  "Name": "my-multihost-network",
  "Options": {}
}

The (host)name for aux-addresses should
be unique, otherwise later values overwrite
earlier values.

Before this change, the example command
would send this API request;

    {
      "Attachable": false,
      "CheckDuplicate": true,
      "Driver": "overlay",
      "EnableIPv6": false,
      "IPAM": {
        "Config": [
          {
            "Gateway": "192.168.0.100",
            "IPRange": "192.168.1.0/24",
            "Subnet": "192.168.0.0/16"
          },
          {
            "AuxiliaryAddresses": {
              "a": "192.170.1.5",
              "b": "192.170.1.6"
            },
            "Gateway": "192.170.0.100",
            "Subnet": "192.170.0.0/16"
          }
        ],
        "Driver": "default",
        "Options": {
        }
      },
      "Internal": false,
      "Labels": {
      },
      "Name": "my-multihost-network",
      "Options": {
      }
    }

After this change, the request looks
like this (all aux-addresses preserved);

    {
      "Attachable": false,
      "CheckDuplicate": true,
      "Driver": "overlay",
      "EnableIPv6": false,
      "IPAM": {
        "Config": [
          {
            "AuxiliaryAddresses": {
              "my-router": "192.168.1.5",
              "my-switch": "192.168.1.6"
            },
            "Gateway": "192.168.0.100",
            "IPRange": "192.168.1.0/24",
            "Subnet": "192.168.0.0/16"
          },
          {
            "AuxiliaryAddresses": {
              "my-printer": "192.170.1.5",
              "my-nas": "192.170.1.6"
            },
            "Gateway": "192.170.0.100",
            "Subnet": "192.170.0.0/16"
          }
        ],
        "Driver": "default",
        "Options": {
        }
      },
      "Internal": false,
      "Labels": {
      },
      "Name": "my-multihost-network",
      "Options": {
      }
    }

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
@thaJeztah thaJeztah force-pushed the fix-aux-address-example branch from 5dfa2c0 to fd7161b Compare September 26, 2016 23:13
@thaJeztah
Copy link
Copy Markdown
Member Author

ping @aboch PTAL 😄

@aboch
Copy link
Copy Markdown
Contributor

aboch commented Sep 26, 2016

Thanks,looks good to me.

Copy link
Copy Markdown
Contributor

@mdlinville mdlinville left a comment

Choose a reason for hiding this comment

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

LGTM

@mdlinville mdlinville merged commit bab64af into moby:master Sep 28, 2016
@thaJeztah thaJeztah deleted the fix-aux-address-example branch September 28, 2016 00:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants