lxc: implement deletion of network interfaces #754
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Closes #753
Disclaimer: I did(/do) not know Go, so there probably is room for improvements. Please tell me how it can be improved and I'll refactor.
Approach
First I tried matching simply based on name (e.g.
eth0
) however I've found this not to be desirable since names don't have to be unique and a simple rename would lead to recreation of a interface.I then switched to using the Proxmox
id
since it does not have these flaws. I'm not 100% happy with the fact that I now need to drop the ids before applying the config. Suggestions for a better approach are welcome.I've tested it quite a bit but certainly more testing would be good. I also don't know the impact on already existing states (since id is now added and was not there before).