diff --git a/playbooks/robusta_playbooks/image_pull_backoff_enricher.py b/playbooks/robusta_playbooks/image_pull_backoff_enricher.py index 54b006f03..8c8a79768 100755 --- a/playbooks/robusta_playbooks/image_pull_backoff_enricher.py +++ b/playbooks/robusta_playbooks/image_pull_backoff_enricher.py @@ -1,9 +1,5 @@ -import enum import logging -from enum import Flag -from typing import List -from hikaru.model.rel_1_26 import ContainerStatus, PodStatus from robusta.api import ( Finding, FindingSeverity, @@ -19,14 +15,6 @@ ) -def get_image_pull_backoff_container_statuses(status: PodStatus) -> List[ContainerStatus]: - return [ - container_status - for container_status in status.containerStatuses - if container_status.state.waiting is not None and container_status.state.waiting.reason == "ImagePullBackOff" - ] - - @action def image_pull_backoff_reporter(event: PodEvent, action_params: RateLimitParams): """ diff --git a/playbooks/robusta_playbooks/job_restart_on_oomkilled_community.py b/playbooks/robusta_playbooks/job_restart_on_oomkilled_community.py index 910c85e69..dee181cc3 100644 --- a/playbooks/robusta_playbooks/job_restart_on_oomkilled_community.py +++ b/playbooks/robusta_playbooks/job_restart_on_oomkilled_community.py @@ -41,7 +41,7 @@ def job_restart_on_oomkilled_community(event: JobEvent, params: IncreaseResource try: pod = get_job_latest_pod(job_event) - except: + except Exception: logging.error(f"get_job_pod was called on event without job: {event}") return @@ -54,7 +54,7 @@ def job_restart_on_oomkilled_community(event: JobEvent, params: IncreaseResource """ OOMKilled = "OOMKilled" for status in pod.status.containerStatuses: - if status.state.running == None: + if status.state.running is None: if status.state.terminated.reason == OOMKilled: oomkilled_containers.append(status.name) else: diff --git a/src/robusta/api/__init__.py b/src/robusta/api/__init__.py index 99bfe2b75..bd70c6b26 100644 --- a/src/robusta/api/__init__.py +++ b/src/robusta/api/__init__.py @@ -267,7 +267,6 @@ ReplicaSetAttributes, ReplicaSetChangeEvent, ReplicaSetEvent, - ResourceAttributes, ResourceLoader, ServiceAccountAttributes, ServiceAccountChangeEvent,