Browse Source

Adapt selfLink calculation for KuryrNetwork CRD objects.

Implements: blueprint selflink
Change-Id: I889178d2bd2718fda2b04057ba45280bda42b0eb
changes/41/768341/8
Roman Dobosz 2 months ago
parent
commit
4fe32c846c
3 changed files with 5 additions and 6 deletions
  1. +3
    -4
      kuryr_kubernetes/controller/handlers/kuryrnetwork.py
  2. +1
    -1
      kuryr_kubernetes/controller/handlers/kuryrnetwork_population.py
  3. +1
    -1
      kuryr_kubernetes/controller/handlers/namespace.py

+ 3
- 4
kuryr_kubernetes/controller/handlers/kuryrnetwork.py View File

@ -21,6 +21,7 @@ from kuryr_kubernetes.controller.drivers import base as drivers
from kuryr_kubernetes.controller.drivers import utils as driver_utils
from kuryr_kubernetes import exceptions as k_exc
from kuryr_kubernetes.handlers import k8s_base
from kuryr_kubernetes import utils
LOG = logging.getLogger(__name__)
@ -146,11 +147,9 @@ class KuryrNetworkHandler(k8s_base.ResourceEventHandler):
try:
if labels:
kubernetes.patch_crd('status',
kuryrnet_crd['metadata']['selfLink'],
status)
utils.get_res_link(kuryrnet_crd), status)
else:
kubernetes.patch('status',
kuryrnet_crd['metadata']['selfLink'],
kubernetes.patch('status', utils.get_res_link(kuryrnet_crd),
status)
except k_exc.K8sResourceNotFound:
LOG.debug('KuryrNetwork CRD not found %s', kuryrnet_crd)


+ 1
- 1
kuryr_kubernetes/controller/handlers/kuryrnetwork_population.py View File

@ -84,7 +84,7 @@ class KuryrNetworkPopulationHandler(k8s_base.ResourceEventHandler):
crd_name = kns_crd['metadata']['name']
LOG.debug('Patching KuryrNetwork CRD %s' % crd_name)
try:
kubernetes.patch_crd('status', kns_crd['metadata']['selfLink'],
kubernetes.patch_crd('status', utils.get_res_link(kns_crd),
{'populated': populated})
except exceptions.K8sClientException:
LOG.exception('Error updating kuryrnet CRD %s', crd_name)


+ 1
- 1
kuryr_kubernetes/controller/handlers/namespace.py View File

@ -97,7 +97,7 @@ class NamespaceHandler(k8s_base.ResourceEventHandler):
kubernetes = clients.get_kubernetes_client()
LOG.debug('Patching KuryrNetwork CRD %s', kns_crd)
try:
kubernetes.patch_crd('spec', kns_crd['metadata']['selfLink'],
kubernetes.patch_crd('spec', utils.get_res_link(kns_crd),
{'nsLabels': ns_labels})
except exceptions.K8sResourceNotFound:
LOG.debug('KuryrNetwork CRD not found %s', kns_crd)


Loading…
Cancel
Save