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."
Reviewed: https:/ /review. openstack. org/237465 /git.openstack. org/cgit/ openstack/ kuryr/commit/ ?id=73f631dc149 5112b57e67cc1a3 0f57f185bf06de
Committed: https:/
Submitter: Jenkins
Branch: master
commit 73f631dc1495112 b57e67cc1a30f57 f185bf06de
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
Interface' : {
u' AddressIPv6' : u''
u' MacAddress' : u'',
u' Address' : u'172.18.0.2/16'
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:
},
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: /github. com/docker/ libnetwork/ blob/master/ docs/remote. md#create- endpoint /github. com/docker/ libnetwork/ blob/master/ drivers/ remote/ driver. go#L136
https:/
https:/
Change-Id: I0acce8c1445791 9f9a9ada5e728a7 1ca36db14e1
Closes-Bug: #1507895