Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add firewall support (orphan mode and normal mode). Add unit tests. #11

Merged
merged 2 commits into from
Sep 14, 2024

Conversation

patrickdappollonio
Copy link
Member

Description

This PR:

  • Adds support for firewall checks. Each firewall has a few parameters in the API that show how many other resources depend on it (see below)
  • Adds unit tests for pretty much every possible combination
  • Makes orphan deletions sequential instead of parallel for easy reading of the output

To verify a firewall is "orphan", we get the count in use for instance, cluster, and loadbalancer. If all 3 are zero, then it's a leftover.

  {
    "id": "415164c0-40ab-4ee5-b92e-768b93bcbcb0",
    "name": "example-a211-9e20a7",
    "account_id": "96eda81a-7a36-4a89-ad4a-69ae28e216a5",
    "rules_count": 6,
    "instance_count": 0,
    "cluster_count": 0,
    "loadbalancer_count": 0,
    "default": "false",
    "label": "",
    "network_id": "464ff5e7-9807-430b-8e1c-22c12414382c",
    "rules": []
  },

Related Issue(s)

Fixes #

How to test

@patrickdappollonio patrickdappollonio self-assigned this Sep 12, 2024
@patrickdappollonio patrickdappollonio merged commit 027e0b5 into main Sep 14, 2024
1 check passed
@patrickdappollonio patrickdappollonio deleted the orphans-and-tests branch September 14, 2024 05:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants