Skip to content

Commit

Permalink
Adds check for default objects
Browse files Browse the repository at this point in the history
  • Loading branch information
linguini-dev committed Feb 4, 2025
1 parent 6b325c9 commit a4a8881
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions ocw/lib/gce.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@ def _delete_resource(self, api_call, resource_name, *_, **kwargs) -> None:
self.compute_client().routes: "route",
self.compute_client().subnetworks: "subnetwork",
}.get(api_call, "resource")
if "default" in resource_name and "firewall" not in resource_type:
self.log_info(f"Skipped deletion of default {resource_type} {resource_name}")
return
if self.dry_run:
self.log_info(f"Deletion of {resource_type} {resource_name} skipped due to dry run mode")
return
Expand Down

0 comments on commit a4a8881

Please sign in to comment.