Skip to content

Commit

Permalink
azure: Clean image versions in Failed provisioning state
Browse files Browse the repository at this point in the history
  • Loading branch information
ricardobranco777 committed May 29, 2024
1 parent 7a224d9 commit 80fba44
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ocw/lib/azure.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,8 +199,8 @@ def cleanup_gallery_img_versions(self) -> None:
if version.tags is not None and Instance.TAG_IGNORE in version.tags:
self.log_info(f"Image version {version} for image {image} in gallery {self.__gallery} has {Instance.TAG_IGNORE} tag")
continue
properties = self.get_resource_properties(version.id)
if self.is_outdated(parse(properties['publishingProfile']['publishedDate'])):
if version.provisioning_state == "Failed" or \
self.is_outdated(parse(self.get_resource_properties(version.id)['publishingProfile']['publishedDate'])):
if self.dry_run:
self.log_info(f"Deletion of version {gallery.name}/{image.name}/{version.name} skipped due to dry run mode")
else:
Expand Down

0 comments on commit 80fba44

Please sign in to comment.