zun is not responsible for port clean, kuryr will do it.
the following explain the bug: https:/
when stop a container, network would unsetup first.
the following steps would be taken, when container disconnect from network
1. POST /NetworkDriver.
2. POST /NetworkDriver.
3. POST /NetworkDriver.
4. POST /IpamDriver.
on master branch of kuryr, let's check kuryr code on 4th step
@app.route(
def ipam_release_
......
try:
fixed_ip = 'ip_address=' + str(rel_ip_address)
all_ports = app.neutron.
for port in all_ports['ports']:
tags = port.get('tags', [])
if ((tags and lib_const.
for tmp_subnet in subnets:
elif tags and const.KURYR_
except n_exceptions.
raise
return flask.jsonify(
since the port was created in zun, port's tag would be marked as const.KURYR_
when start a container, network would be setup first.
the flowing steps would be taken, when container connect to network
1. POST /IpamDriver.
2. POST /NetworkDriver.
3. POST /NetworkDriver.Join
4. POST /NetworkDriver.
5. POST /NetworkDriver.
on master branch of kuryr, let's check kuryr code on 2th step
there is a function invoked stack: _create_
def update_port(self, port, endpoint_id, interface_mac):
"""Updates port information and performs extra driver-specific actions.
It returns the updated port dictionary after the required actions
performed depending on the binding driver.
:param port: a neutron port dictionary returned from
:param endpoint_id: the ID of the endpoint as string
:param interface_mac: the MAC address of the endpoint
:returns: the updated Neutron port id dictionary as returned by
"""
try:
}
if not port.get(
if interface_mac:
so, for the bug: https:/
when stop a container, the device_id(value: container_uuid) is wiped, then start the container, the endpoint of the docker as device_id will be written in port .
therefor, zun don't need to cleanup port.
Blueprint information
- Status:
- Complete
- Approver:
- Hongbin Lu
- Priority:
- Undefined
- Drafter:
- Wang Changyu
- Direction:
- Needs approval
- Assignee:
- Wang Changyu
- Definition:
- Superseded
- Series goal:
- None
- Implementation:
- Unknown
- Milestone target:
- None
- Started by
- Completed by
- Wang Changyu
Related branches
Related bugs
Sprints
Whiteboard
Gerrit topic: https:/
Addressed by: https:/
kuryr will cleanup port device_id when docker disconnect
(hongbin 2018-03-04): Hi Wang Changyu, I agree what you said until "so, for the bug: https:/
(changyu 2018-03-05):yes, u r right. I will fix the bug in kuryr-libnetwork. thanks
https:/