Skip to content

Commit

Permalink
Fixing review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
jyejare committed Sep 19, 2024
1 parent 2d7e186 commit 4629f37
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
13 changes: 6 additions & 7 deletions cloudwash/entities/resources/containers.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,17 +45,16 @@ class CleanPodmanContainers(CleanContainers):
def list(self):

for container in self.client.containers:
container_name = container.name
if container_name in settings.podman.exceptions.container.skip_list:
self._skip.append(container_name)
if container.name in settings.podman.exceptions.container.skip_list:
self._skip.append(container.name)
continue
elif total_running_time(container).minutes >= settings.podman.criteria.container.sla:

if container_name in settings.podman.exceptions.container.stop_list:
self._stop.append(container_name)
if container.name in settings.podman.exceptions.container.stop_list:
self._stop.append(container.name)
continue

elif container_name.startswith(settings.podman.criteria.container.name_prepend):
self._delete.append(container_name)
elif container.name.startswith(settings.podman.criteria.container.name_prefix):
self._delete.append(container.name)

self._set_dry()
4 changes: 2 additions & 2 deletions settings.yaml.template
Original file line number Diff line number Diff line change
Expand Up @@ -117,12 +117,12 @@ PODMAN:
CRITERIA:
CONTAINER:
# Container Prepended Test
NAME_PREPEND: 'satci'
NAME_PREFIX: 'satci'
# Container running time in minutes
SLA: 720
EXCEPTIONS:
CONTAINER:
# Containers to skip and not to delete
SKIP_LIST: []
# Contsiners to stop if running but not delete
# Containers to stop if running but not delete
STOP_LIST: []

0 comments on commit 4629f37

Please sign in to comment.