Skip to content

Commit

Permalink
Fixed the count zombie_cluster resources
Browse files Browse the repository at this point in the history
  • Loading branch information
athiruma committed Aug 19, 2024
1 parent 6cbdcea commit 193fc3f
Showing 1 changed file with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -129,13 +129,19 @@ def _get_tags_of_zombie_resources(self, resources: list, resource_id_name: str,
cluster_delete_days = self.get_tag_name_from_tags(tags=tags, tag_name='ClusterDeleteDays')
if cluster_delete_days:
if resource_id in zombies:
tags = self.update_resource_tags(tags=tags, tag_name='ClusterDeleteDays',
tag_value=str(int(cluster_delete_days) + 1))
if self.dry_run == 'no':
tags = self.update_resource_tags(tags=tags, tag_name='ClusterDeleteDays',
tag_value=str(int(cluster_delete_days) + 1))
else:
tags = self.update_resource_tags(tags=tags, tag_name='ClusterDeleteDays', tag_value=str(0))
else:
tags = self.update_resource_tags(tags=tags, tag_name='ClusterDeleteDays', tag_value=str(0))
else:
if resource_id in zombies:
tags = self.update_resource_tags(tags=tags, tag_name='ClusterDeleteDays', tag_value=str(1))
if self.dry_run == 'no':
tags = self.update_resource_tags(tags=tags, tag_name='ClusterDeleteDays', tag_value=str(1))
else:
tags = self.update_resource_tags(tags=tags, tag_name='ClusterDeleteDays', tag_value=str(0))
if old_tags != tags:
try:
if aws_service == 'ec2':
Expand Down

0 comments on commit 193fc3f

Please sign in to comment.