diff --git a/operators/crownlabs-image-list/update-crownlabs-image-list.py b/operators/crownlabs-image-list/update-crownlabs-image-list.py index 6ad0e1883..f6eb0e788 100644 --- a/operators/crownlabs-image-list/update-crownlabs-image-list.py +++ b/operators/crownlabs-image-list/update-crownlabs-image-list.py @@ -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) @@ -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 diff --git a/operators/crownlabs-image-list/update-crownlabs-image-list.yaml b/operators/crownlabs-image-list/update-crownlabs-image-list.yaml index c51268bb6..0994549d4 100644 --- a/operators/crownlabs-image-list/update-crownlabs-image-list.yaml +++ b/operators/crownlabs-image-list/update-crownlabs-image-list.yaml @@ -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