Skip to content

Adding a / at the end of a pool target path causes inconsistent result error #1245

@anthonyl6

Description

@anthonyl6

Libvirt does not add a trailing / in the path for pools but the provider does not warn of this, which causes an inconsistent result error in terraform.

Error: Provider produced inconsistent result after apply

When applying changes to libvirt_pool.lab_pool, provider "provider["registry.terraform.io/dmacvicar/libvirt"]" produced an unexpected new value: .target.path: was cty.StringVal("/mnt/nvme/pool/", but now
cty.StringVal("/mnt/nvme/pool/").

Breaking code

resource "libvirt_pool" "lab_pool" { name = "Lab Pool" type = "dir" target = { path = "/mnt/nvme/pool/" } }

Fix

resource "libvirt_pool" "lab_pool" { name = "Lab Pool" type = "dir" target = { path = "/mnt/nvme/pool" # removed trailing slash } }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions