Comment 2 for bug 1507895

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to kuryr (master)

Reviewed: https://review.openstack.org/237465
Committed: https://git.openstack.org/cgit/openstack/kuryr/commit/?id=73f631dc1495112b57e67cc1a30f57f185bf06de
Submitter: Jenkins
Branch: master

commit 73f631dc1495112b57e67cc1a30f57f185bf06de
Author: Vikas Choudhary <email address hidden>
Date: Tue Oct 20 14:04:01 2015 +0530

    Fix /NetworkDriver.CreateEndpoint return value form

    In current implementation, allocated port configuration is passed as
    return value in interface description in both the cases:
    1. remote network driver was supplied a non-empty value in Interface
    2. remote network driver was supplied empty value in Interface
    But for non-empty interface case, libnetwork expects empty values
    of interface description fields which are passed non-empty value.
    For example if input interface is:
            Interface': {
                    u'AddressIPv6': u''
                    u'MacAddress': u'',
                    u'Address': u'172.18.0.2/16'
            },
    In the response interface description, 'Address' MUST be empty. For
    empty fields in request, accepted reponse values are both empty or
    non-empty. If kuryr driver has allocated IP it should be sent back in
    response, so that in 'docker inspect' output user can see kuryr
    allocated IP.
    But for non-empty field in request, only empty response
    is considered success.

    "If the remote process was supplied a non-empty value in Interface, it
    must respond with an empty Interface value. LibNetwork will treat it
    as an error if it supplies a non-empty value and receives a non-empty
    value back, and roll back the operation."

    Reference:
    https://github.com/docker/libnetwork/blob/master/docs/remote.md#create-endpoint
    https://github.com/docker/libnetwork/blob/master/drivers/remote/driver.go#L136

    Change-Id: I0acce8c14457919f9a9ada5e728a71ca36db14e1
    Closes-Bug: #1507895