Skip to content
This repository was archived by the owner on Apr 25, 2025. It is now read-only.
Open
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
13 changes: 7 additions & 6 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ def initialize():
IMAGES_TO_KEEP = int(os.environ.get('IMAGES_TO_KEEP', 100))
IGNORE_TAGS_REGEX = os.environ.get('IGNORE_TAGS_REGEX', "")


def handler(event, context):
initialize()
if REGION == "None":
Expand Down Expand Up @@ -148,14 +149,14 @@ def discover_delete_images(regionname):
print("Nothing to delete in repository : " + repository['repositoryName'])


def append_to_list(list, id):
if not {'imageDigest': id} in list:
list.append({'imageDigest': id})
def append_to_list(items, val):
if {'imageDigest': val} not in items:
items.append({'imageDigest': val})


def append_to_tag_list(list, id):
if not id in list:
list.append(id)
def append_to_tag_list(tags, tag):
if tag not in tags:
tags.append(tag)


def chunks(l, n):
Expand Down