Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fixed floating ip deleted and introspect
1. Fixed floating ip being deleted after all endpoints
are deleted by removing the reference to the vmi of endpoints
2. Fixed introspect display issue and removed selectors from lb
as selectors can be retrieved from kubernetes.

Change-Id: Iefebe9912ff75e85dd19c63c6133a4f9c1e8a5ba
Closes-Bug: #1781186
Closes-Bug: #1772603
  • Loading branch information
pvijayaragav committed Jul 20, 2018
1 parent df796dd commit b624a9c
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
Expand Up @@ -386,7 +386,7 @@ def _update_metadata(self, md):
return
self.name = md.get('name')
self.namespace = md.get('namespace')
self.labels = md.get('labels')
self.labels = md.get('labels', {})

def _update_spec(self, spec):
if spec is None:
Expand Down
7 changes: 2 additions & 5 deletions src/container/kube-manager/kube_manager/vnc/config_db.py
Expand Up @@ -325,9 +325,6 @@ def sandesh_handle_db_list_request(cls, req):

lb_annotations = cls._build_annotation_dict(lb.annotations)

selectors = []
if lb.selectors:
selectors = lb.selectors
lb_listeners = cls._build_cls_uuid_list(
introspect.LbListenerUuid, lb.loadbalancer_listeners)
vmis = cls._build_cls_uuid_list(
Expand All @@ -342,7 +339,7 @@ def sandesh_handle_db_list_request(cls, req):
annotations=lb_annotations,
external_ip=str(lb.external_ip),
lb_listeners=lb_listeners,
selectors=selectors,
selectors=None,
vm_interfaces=vmis)
else:
lb_instance = introspect.LoadbalancerInstance(
Expand All @@ -352,7 +349,7 @@ def sandesh_handle_db_list_request(cls, req):
annotations=lb_annotations,
external_ip=str(lb.external_ip),
lb_listeners=lb_listeners,
selectors=selectors,
selectors=None,
vm_interfaces=vmis)

# Append the constructed element info to the response.
Expand Down
7 changes: 6 additions & 1 deletion src/container/kube-manager/kube_manager/vnc/vnc_pod.py
Expand Up @@ -455,7 +455,10 @@ def vnc_port_delete(self, vmi_id, pod_id):
# Cleanup floating ip's on this interface.
for fip_id in list(vmi.floating_ips):
try:
self._vnc_lib.floating_ip_delete(id=fip_id)
self._vnc_lib.ref_update('floating-ip', fip_id,
'virtual-machine-interface', vmi_id, None,
'DELETE')
FloatingIpKM.update(fip_id)
except NoIdError:
pass

Expand All @@ -464,6 +467,8 @@ def vnc_port_delete(self, vmi_id, pod_id):
except NoIdError:
pass

VirtualMachineInterfaceKM.delete(vmi_id)

def vnc_pod_delete(self, pod_id):
vm = VirtualMachineKM.get(pod_id)
if not vm:
Expand Down

0 comments on commit b624a9c

Please sign in to comment.