/NetworkDriver.CreateEndpoint is not returning as expected by libnetwork and failing

Bug #1507895 reported by vikas choudhary
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
kuryr
Fix Committed
Undecided
vikas choudhary

Bug Description

In current implementation, allocated port configuration is passed as return value in interface description in both 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 interface description as success response.

"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."

https://github.com/docker/libnetwork/blob/master/docs/remote.md#create-endpoint

ERROR_LOGS:

root@vikas-VirtualBox:/home/vikas/kuryr# docker run --net=voo -itd --name=container1 busybox
43913b1d6a5098381c62a8819eb4a87397744f8f1ac5491ddafdc434eaab0541
Error response from daemon: Cannot start container 43913b1d6a5098381c62a8819eb4a87397744f8f1ac5491ddafdc434eaab0541: failed to create endpoint container1 on network voo: driver modified interface address: endpoint interface IP present (172.18.0.2/16). Cannot be modified with (172.18.0.2/16).; rolled back

Changed in kuryr:
status: New → In Progress
assignee: nobody → vikas choudhary (choudharyvikas16)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to kuryr (master)

Fix proposed to branch: master
Review: https://review.openstack.org/237465

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

Changed in kuryr:
status: In Progress → Fix Committed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.