Browse Source

Adapt selfLink calculation for Endpoints objects.

Implements: blueprint selflink
Change-Id: Iaf6bc954624def675d6c1769873c5e5277390542
changes/44/768344/8
Roman Dobosz 2 months ago
parent
commit
caf098f0df
2 changed files with 4 additions and 4 deletions
  1. +2
    -2
      kuryr_kubernetes/controller/handlers/lbaas.py
  2. +2
    -2
      kuryr_kubernetes/utils.py

+ 2
- 2
kuryr_kubernetes/controller/handlers/lbaas.py View File

@ -437,13 +437,13 @@ class EndpointsHandler(k8s_base.ResourceEventHandler):
k8s = clients.get_kubernetes_client()
service_link = utils.get_service_link(endpoints)
to_remove = [
(endpoints['metadata']['selfLink'],
(utils.get_res_link(endpoints),
k_const.K8S_ANNOTATION_LBAAS_SPEC),
(service_link,
k_const.K8S_ANNOTATION_LBAAS_SPEC),
]
if state:
to_remove.append((endpoints['metadata']['selfLink'],
to_remove.append((utils.get_res_link(endpoints),
k_const.K8S_ANNOTATION_LBAAS_STATE))
for path, name in to_remove:


+ 2
- 2
kuryr_kubernetes/utils.py View File

@ -424,7 +424,7 @@ def set_lbaas_state(endpoints, lbaas_state):
annotation = jsonutils.dumps(lbaas_state.obj_to_primitive(),
sort_keys=True)
k8s = clients.get_kubernetes_client()
k8s.annotate(endpoints['metadata']['selfLink'],
k8s.annotate(get_res_link(endpoints),
{constants.K8S_ANNOTATION_LBAAS_STATE: annotation},
resource_version=endpoints['metadata']['resourceVersion'])
@ -442,7 +442,7 @@ def get_endpoints_link(service):
def get_service_link(endpoints):
endpoints_link = endpoints['metadata']['selfLink']
endpoints_link = get_res_link(endpoints)
link_parts = endpoints_link.split('/')
if link_parts[-2] != 'endpoints':


Loading…
Cancel
Save