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

Improve handling of resource deletion #3

Open
charlie-haley opened this issue Aug 17, 2022 · 0 comments
Open

Improve handling of resource deletion #3

charlie-haley opened this issue Aug 17, 2022 · 0 comments

Comments

@charlie-haley
Copy link
Owner

Currently the handling of resource deletion works, but it leaves behind some mess. When deleting the entire contents of an object, we should ensure the root property is cleaned up.

Example, if we have the following VyConfigure YAML config:

ipv6-name:
  WAN_IN:
    default-action: drop
    rule:
      "10":
        action: accept
        state:
          established: enable
          related: enable
      "20": {}

Then, we decide we want to delete the rule named "10", then run vyconfigure plan, we get the following command output:

- delete firewall ipv6-name WAN_IN rule 10 action
- delete firewall ipv6-name WAN_IN rule 10 state established
- delete firewall ipv6-name WAN_IN rule 10 state related

As we're deleting the entire property and all of its children, the deletion command can simplified to something like this:

- delete firewall ipv6-name WAN_IN rule 10
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

No branches or pull requests

1 participant