Improve LOG messaging

Changing exception logging by debug info. That is the expected
behavior when a pod is created right after creating the namespace
since the namespaces resources may take some time (seconds) to be
created. This ensures the user is not misled due to the
kuryr-controller logs.

Change-Id: Ie8c5e22741015a3417c7ab143d3c6dd0b4b8062d
(cherry picked from commit 19580e32bb)
This commit is contained in:
Luis Tomas Bolivar 2019-10-11 15:57:41 +02:00 committed by Michał Dulko
parent df5d7cbd0f
commit 2649acb2d7
2 changed files with 5 additions and 5 deletions

View File

@ -55,8 +55,8 @@ def _get_net_crd(namespace):
annotations = ns['metadata']['annotations']
net_crd_name = annotations[constants.K8S_ANNOTATION_NET_CRD]
except KeyError:
LOG.exception("Namespace missing CRD annotations for selecting "
"the corresponding security group.")
LOG.debug("Namespace missing CRD annotations for selecting the "
"corresponding security group. Action will be retried.")
raise exceptions.ResourceNotReady(namespace)
try:
net_crd = kubernetes.get('%s/kuryrnets/%s' % (constants.K8S_API_CRD,

View File

@ -64,15 +64,15 @@ class NamespacePodSubnetDriver(default_subnet.DefaultPodSubnetDriver):
annotations = ns['metadata']['annotations']
net_crd_name = annotations[constants.K8S_ANNOTATION_NET_CRD]
except KeyError:
LOG.warning("Namespace missing CRD annotations for selecting the "
"corresponding subnet.")
LOG.debug("Namespace missing CRD annotations for selecting "
"the corresponding subnet.")
raise exceptions.ResourceNotReady(namespace)
try:
net_crd = kubernetes.get('%s/kuryrnets/%s' % (
constants.K8S_API_CRD, net_crd_name))
except exceptions.K8sResourceNotFound:
LOG.warning("Kuryrnet resource not yet created, retrying...")
LOG.debug("Kuryrnet resource not yet created, retrying...")
raise exceptions.ResourceNotReady(net_crd_name)
except exceptions.K8sClientException:
LOG.exception("Kubernetes Client Exception.")