Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 3 additions & 7 deletions tests/install_upgrade_operators/node_component/utils.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import logging
from collections import defaultdict

from kubernetes.client.rest import ApiException
from kubernetes.dynamic.exceptions import NotFoundError, ResourceNotFoundError
from kubernetes.dynamic.exceptions import NotFoundError
Comment thread
albarker-rh marked this conversation as resolved.
from ocp_resources.pod import Pod
from ocp_resources.resource import ResourceEditor
from timeout_sampler import TimeoutExpiredError, TimeoutSampler
Expand Down Expand Up @@ -354,11 +353,8 @@ def _get_pods_per_nodes(_filter_pods_by_name):
# to filter out terminating pods, see: https://github.com/kubernetes/kubectl/issues/450
if pod.instance.metadata.get("deletionTimestamp") is None:
pods_per_nodes[pod.node.name].append(pod)
except ApiException as ex:
if ex.reason == ResourceNotFoundError:
LOGGER.debug(
f"Ignoring pods that disappeared during the query. node={pod.node.name} pod={pod.name}"
)
except NotFoundError:
LOGGER.warning(f"Ignoring pods that disappeared during the query. node={pod.node.name} pod={pod.name}")
return pods_per_nodes

pod_names_per_nodes = {}
Expand Down
Loading