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

fix(lxc): panic on empty initialization.ip_config block #977

Merged
merged 1 commit into from
Jan 28, 2024

Conversation

bpg
Copy link
Owner

@bpg bpg commented Jan 28, 2024

Contributor's Note

  • I have added / updated documentation in /docs for any user-facing features or additions.
  • I have added / updated templates in /example for any new or updated resources / data sources.
  • I have ran make example to verify that the change works as expected.

Proof of Work

Apply & reapply a template with

  initialization {
    ip_config {}
  }
Terraform used the selected providers to generate the following execution plan. Resource actions are indicated with the following symbols:
  ~ update in-place

Terraform will perform the following actions:

  # proxmox_virtual_environment_container.test_container will be updated in-place
  ~ resource "proxmox_virtual_environment_container" "test_container" {
        id            = "102"
        tags          = []
        # (7 unchanged attributes hidden)

      ~ initialization {
            # (1 unchanged attribute hidden)

          + ip_config {
            }

            # (1 unchanged block hidden)
        }

        # (5 unchanged blocks hidden)
    }

Plan: 0 to add, 1 to change, 0 to destroy.
proxmox_virtual_environment_container.test_container: Modifying... [id=102]
proxmox_virtual_environment_container.test_container: Modifications complete after 0s [id=102]

Apply complete! Resources: 0 added, 1 changed, 0 destroyed.

Community Note

  • Please vote on this pull request by adding a 👍 reaction to the original pull request comment to help the community and maintainers prioritize this request
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for pull request followers and do not help prioritize the request

Closes #936

Signed-off-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>
@bpg bpg enabled auto-merge (squash) January 28, 2024 02:08
Copy link

@mergify mergify bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 LGTM! beep boop

@bpg bpg merged commit 0253eb9 into main Jan 28, 2024
7 checks passed
@bpg bpg deleted the fix-paic-container-empty-interface branch January 28, 2024 02:09
@arcnmx
Copy link

arcnmx commented Feb 18, 2024

While the panic was fixed, it seems that the empty block still causes issues in that the state after refresh/plan/etc never settles even though it will apply now:

# proxmox_virtual_environment_container.lxc_container will be updated in-place
resource "proxmox_virtual_environment_container" "lxc_container" {
  id            = "100"
  # (7 unchanged attributes hidden)
~ initialization {
    # (1 unchanged attribute hidden)
  + ip_config {
    }
    # (2 unchanged blocks hidden)
  }
  # (9 unchanged blocks hidden)
}

@bpg
Copy link
Owner Author

bpg commented Feb 19, 2024

Hi @arcnmx,

I've already commented on the other issue, the empty block will always be detected as a pending change. This happens because even though the block is defined in a template and exists in the local state after you run apply, there is nothing related to it one the remote, so the remote state reads as empty.

@bpg bpg mentioned this pull request Jun 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Provider panic when empty ip_config is present in initialization section, when provisioning container
2 participants