Skip to content

Commit

Permalink
crownlabs-image-list: fix bug
Browse files Browse the repository at this point in the history
  • Loading branch information
giorio94 committed Sep 7, 2020
1 parent 6bbfec8 commit 7db5a74
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
13 changes: 8 additions & 5 deletions operators/crownlabs-image-list/update-crownlabs-image-list.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ def _run_periodically(self, interval, action, *args, **kwargs):

logger.debug(f"Executing '{action.__name__}': next scheduled in {interval} seconds")

# Schedule the next executen
# Schedule the next execution
self.scheduler.enter(
delay=interval, priority=1, action=self._run_periodically,
argument=(interval, action), kwargs=kwargs)
Expand All @@ -96,17 +96,20 @@ def __process_image_list(images):

for image in images:

# Remove the "latest" tags
# Get the available tags
versions = image.get("tags") or []

# Remove the "latest" tag
try:
image.get("tags", []).remove("latest")
versions.remove("latest")
except ValueError:
pass

# Are there still any tags?
if image.get("tags", []):
if versions:
converted_images.append({
"name": image.get("name"),
"versions": image.get("tags"),
"versions": versions,
})

return converted_images
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ spec:
serviceAccountName: update-crownlabs-image-list
containers:
- name: update-crownlabs-image-list
image: crownlabs/update-crownlabs-image-list:v0.1-crown
image: crownlabs/update-crownlabs-image-list:v0.1.1-crown
imagePullPolicy: Always
args:
- --advertised-registry-name=registry.internal.crownlabs.polito.it
Expand Down

0 comments on commit 7db5a74

Please sign in to comment.