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

Terraform crash when using docker_network with aux_address = {foo: ip} #7

Closed
dubo-dubon-duponey opened this issue Dec 1, 2020 · 1 comment · Fixed by #8
Closed
Labels
bug Something isn't working r/network Relates to the network resource

Comments

@dubo-dubon-duponey
Copy link
Contributor

dubo-dubon-duponey commented Dec 1, 2020

Terraform Version

0.13.5

Affected Resource(s)

docker_network

Terraform Configuration Files

resource "docker_network" "vlan" {
  ipam_config {
    aux_address = {
      foo: "1.2.3.4"
   }
  }
}

Panic Output

I can't do that right now.
The config is massive and does leak a lot of important info that I would have to scrub out first.

The bug is easy to reproduce though.

Expected Behavior

Not crash.

Actual Behavior

Crash.

Steps to Reproduce

  1. terraform apply

Notes

I'm out of my depth here.

Feels to me though that:

auxAddressRaw := ipamConfigRaw["aux_address"].(map[string]interface{})

^ is problematic

@suzuki-shunsuke
Copy link
Collaborator

suzuki-shunsuke commented Dec 2, 2020

I could reproduce the panic.

$ terraform version
Terraform v0.13.5
+ provider registry.terraform.io/kreuzwerker/docker v2.8.0
resource "docker_network" "vlan" {
  name = "pr-8"
  ipam_config {
    subnet = "192.168.0.0/16"
    aux_address = {
      foo : "192.168.1.5"
    }
  }
}

provider "docker" {
}

terraform {
  required_providers {
    docker = {
      source = "kreuzwerker/docker"
    }
  }
  required_version = ">= 0.13"
}
$ TF_LOG=DEBUG terraform apply
...

panic: interface conversion: interface {} is map[string]string, not map[string]interface {}

...

2020-12-02T12:24:36.815+0900 [DEBUG] plugin.terraform-provider-docker_v2.8.0:   github.com/terraform-providers/terraform-provider-docker/docker/resource_docker_network_funcs.go:231 +0x329

...

AuxAddress is map[string]string, so I guess we have to convert it to map[string]interface{}.

@suzuki-shunsuke suzuki-shunsuke added the bug Something isn't working label Dec 2, 2020
@mavogel mavogel added the r/network Relates to the network resource label Dec 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working r/network Relates to the network resource
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants