Skip to content

Conversation

dmacvicar
Copy link
Owner

@dmacvicar dmacvicar commented Sep 15, 2024

https://libvirt.org/formatnetwork.html#addressing specifies dns is disabled only if enable="no", but if omitted, it is enabled by default.

However, it claims if disabled, it would ignore the dns entries, but in reality it fails with "error: XML error: Extra data in disabled network".

terraform-provider-libvirt defaults to enabled=false, and it seems it was accidentally introduced with #969

This change makes:

  • if enabled is omitted, we use the libvirt default
  • we only add dns information to the xml if enabled

This also fixes the testacc testsuite, which was failing due to this "error: XML error: Extra data in disabled network" problem.

Fixes #1079

https://libvirt.org/formatnetwork.html#addressing specifies dns is disabled only if
enable="no", but if omitted, it is enabled by default.

However, it claims if disabled, it would ignore the dns entries, but in reality
it fails with "error: XML error: Extra data in disabled network".

This change makes:

- if enabled is omitted, we use the libvirt default
- we only add dns information to the xml if enabled
@dmacvicar dmacvicar added Feedback wanted Important (Wanted) Feature or contribution desired to be had and merged labels Sep 15, 2024
@dmacvicar dmacvicar self-assigned this Sep 15, 2024
@dmacvicar dmacvicar merged commit ec7a38d into main Sep 19, 2024
4 checks passed
dmacvicar added a commit to jimnydev/terraform-provider-libvirt that referenced this pull request Sep 28, 2024
https://libvirt.org/formatnetwork.html#addressing specifies dns is disabled only if
enable="no", but if omitted, it is enabled by default.

However, it claims if disabled, it would ignore the dns entries, but in reality
it fails with "error: XML error: Extra data in disabled network".

This change makes:

- if enabled is omitted, we use the libvirt default
- we only add dns information to the xml if enabled
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feedback wanted Important (Wanted) Feature or contribution desired to be had and merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fix testsuite (or code) " Extra data in disabled network"
1 participant