Skip to content

Commit

Permalink
fix(lxc): panic on empty initialization.ip_config block (#977)
Browse files Browse the repository at this point in the history
Signed-off-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>
  • Loading branch information
bpg authored Jan 28, 2024
1 parent 0e2eb80 commit 0253eb9
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions proxmoxtf/resource/container.go
Original file line number Diff line number Diff line change
Expand Up @@ -1341,6 +1341,10 @@ func containerCreateCustom(ctx context.Context, d *schema.ResourceData, m interf
initializationIPConfig := initializationBlock[mkResourceVirtualEnvironmentContainerInitializationIPConfig].([]interface{})

for _, c := range initializationIPConfig {
if c == nil {
continue
}

configBlock := c.(map[string]interface{})
ipv4 := configBlock[mkResourceVirtualEnvironmentContainerInitializationIPConfigIPv4].([]interface{})

Expand Down Expand Up @@ -2641,6 +2645,10 @@ func containerUpdate(ctx context.Context, d *schema.ResourceData, m interface{})
initializationIPConfig := initializationBlock[mkResourceVirtualEnvironmentContainerInitializationIPConfig].([]interface{})

for _, c := range initializationIPConfig {
if c == nil {
continue
}

configBlock := c.(map[string]interface{})
ipv4 := configBlock[mkResourceVirtualEnvironmentContainerInitializationIPConfigIPv4].([]interface{})

Expand Down

0 comments on commit 0253eb9

Please sign in to comment.