Adapt selfLink calculation for Endpoints objects.
Implements: blueprint selflink Change-Id: Iaf6bc954624def675d6c1769873c5e5277390542
This commit is contained in:
parent
94e5f92791
commit
caf098f0df
|
@ -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:
|
||||
|
|
|
@ -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…
Reference in New Issue