-
Notifications
You must be signed in to change notification settings - Fork 2
Fix deletion for single-array-only resources #84
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
base: main
Are you sure you want to change the base?
Fix deletion for single-array-only resources #84
Conversation
Singleton resources (ones without a DELETE endpoint) don't do anything on delete, leaving the infrastructure still configured. Aside from being unexpected, this also sometimes blocks deletion of other resources (like in CiscoDevNet#82). Some resources (mostly ones with a single "rules" list attribute) were changed to instead do a PUT with an empty list, fixing the issue for those resources. Do that for the rest of such resources (ones with a single attribute that is a list of maps). Note that 79 resources that do nothing on delete still remain after this change. The issue will have to be documented and the resources fixed manually on a case-by-case basis by inferring the expected behavior from the UI.
Please could we also evaluate the following to this PR for consideration: I don't believe any special handiling is required other than return an empty list. gen/definitions/appliance_static_route.yaml gen/definitions/appliance_traffic_shaping_custom_performance_class.yaml - When we create a custom class. |
This is not a singleton resource, so deletes happen normally for it:
As above - this is not a singleton resource and handles
This does have 2 lists-of-maps (
This has 2 lists-of-maps ( |
I think just an empty list for ({vpn,wan}_traffic_uplink_preferences) would remove any of the other fields ?
Yes for custom and major_apps. There is a potential for other configuration deployed by another resource to cause an issue if this isnt deleted. |
I don't think so, but I can test.
I'll do this in this PR. |
Do a PUT with all fields ("custom" and "majorApplications") set to `[]`.
About
I haven't tested the others to confirm they work yet. |
Ok, for now please attempt to only pass empty list to traffic filters only nested under each parent ({vpn,wan}_traffic_uplink_preferences) as these are the Lists that are causing the errors. We may also require handiling of
|
Singleton resources (ones without a DELETE endpoint) don't do anything on delete,
leaving the infrastructure still configured.
Aside from being unexpected,
this also sometimes blocks deletion of other resources (like in #82).
Some resources (mostly ones with a single "rules" list attribute) were changed to instead do a PUT with an empty list, fixing the issue for those resources.
Do that for the rest of such resources
(ones with a single attribute that is a list of maps).
Note that 79 resources that do nothing on delete
still remain after this change.
The issue will have to be documented
and the resources fixed manually on a case-by-case basis by inferring the expected behavior from the UI.
TODO: Test this.
TODO Make an issue with the rest of the resources listed.