Skip to content
This repository has been archived by the owner on Dec 11, 2020. It is now read-only.

Commit

Permalink
Update to Terraform 0.12 (#150). Closes #144
Browse files Browse the repository at this point in the history
* Update to terraform 0.12
* Fix acceptance tests to make syntax 0.12 compatible.
  • Loading branch information
mkeeler authored and mavogel committed Jun 10, 2019
1 parent 62ddaf9 commit a789ce2
Show file tree
Hide file tree
Showing 1,184 changed files with 207,472 additions and 34,789 deletions.
121 changes: 55 additions & 66 deletions docker/resource_docker_container_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1296,18 +1296,16 @@ resource "docker_container" "foo_mounts" {
name = "tf-test"
image = "${docker_image.foo_mounts.latest}"
mounts = [
{
target = "/mount/test"
source = "${docker_volume.foo_mounts.name}"
type = "volume"
read_only = true
},
{
target = "/mount/tmpfs"
type = "tmpfs"
}
]
mounts {
target = "/mount/test"
source = "${docker_volume.foo_mounts.name}"
type = "volume"
read_only = true
}
mounts {
target = "/mount/tmpfs"
type = "tmpfs"
}
}
`

Expand Down Expand Up @@ -1352,7 +1350,7 @@ resource "docker_container" "foo" {
dns = ["8.8.8.8"]
dns_opts = ["rotate"]
dns_search = ["example.com"]
labels {
labels = {
env = "prod"
role = "test"
}
Expand All @@ -1363,12 +1361,10 @@ resource "docker_container" "foo" {
}
network_mode = "bridge"
networks_advanced = [
{
name = "${docker_network.test_network.name}"
aliases = ["tftest"]
}
]
networks_advanced {
name = "${docker_network.test_network.name}"
aliases = ["tftest"]
}
host {
host = "testhost"
Expand Down Expand Up @@ -1443,7 +1439,7 @@ resource "docker_image" "foo" {
resource "docker_container" "foo" {
name = "tf-test"
image = "${docker_image.foo.latest}"
ports {
internal = 80
}
Expand All @@ -1459,15 +1455,14 @@ resource "docker_image" "foo" {
resource "docker_container" "foo" {
name = "tf-test"
image = "${docker_image.foo.latest}"
ports = [
{
internal = 80
},
{
internal = 81
}
]
ports {
internal = 80
}
ports {
internal = 81
}
}
`
const testAccDockerContainerPortConfig = `
Expand Down Expand Up @@ -1496,16 +1491,16 @@ resource "docker_container" "foo" {
name = "tf-test"
image = "${docker_image.foo.latest}"
ports = [
{
internal = 80
external = 32787
},
{
internal = 81
external = 32788
}
]
ports {
internal = 80
external = 32787
}
ports {
internal = 81
external = 32788
}
}
`

Expand Down Expand Up @@ -1586,12 +1581,10 @@ resource "docker_image" "foo" {
resource "docker_container" "foo" {
name = "tf-test"
image = "${docker_image.foo.latest}"
networks_advanced = [
{
name = "${docker_network.test.name}",
ipv4_address = "10.0.1.123"
}
]
networks_advanced {
name = "${docker_network.test.name}"
ipv4_address = "10.0.1.123"
}
}
`
const testAccDockerContainerNetworksIPv6AddressConfig = `
Expand All @@ -1609,26 +1602,24 @@ resource "docker_image" "foo" {
resource "docker_container" "foo" {
name = "tf-test"
image = "${docker_image.foo.latest}"
networks_advanced = [
{
name = "${docker_network.test.name}",
ipv6_address = "fd00:0:0:0::123"
}
]
networks_advanced {
name = "${docker_network.test.name}"
ipv6_address = "fd00:0:0:0::123"
}
}
`
const testAccDockerContainerNetworksDualStackAddressConfig = `
resource "docker_network" "test" {
name = "tf-test"
ipv6 = true
ipam_config = [
{
subnet = "10.0.1.0/24"
},
{
subnet = "fd00::1/64"
}
]
ipam_config {
subnet = "10.0.1.0/24"
}
ipam_config {
subnet = "fd00::1/64"
}
}
resource "docker_image" "foo" {
name = "nginx:latest"
Expand All @@ -1637,13 +1628,11 @@ resource "docker_image" "foo" {
resource "docker_container" "foo" {
name = "tf-test"
image = "${docker_image.foo.latest}"
networks_advanced = [
{
name = "${docker_network.test.name}",
ipv4_address = "10.0.1.123"
ipv6_address = "fd00:0:0:0::123"
}
]
networks_advanced {
name = "${docker_network.test.name}"
ipv4_address = "10.0.1.123"
ipv6_address = "fd00:0:0:0::123"
}
}
`
const testAccDockerContainerRmConfig = `
Expand Down
2 changes: 1 addition & 1 deletion docker/resource_docker_network_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ func testAccNetworkLabel(network *types.NetworkResource, name string, value stri
const testAccDockerNetworkLabelsConfig = `
resource "docker_network" "foo" {
name = "test_foo"
labels {
labels = {
"com.docker.compose.network" = "foo"
"com.docker.compose.project" = "test"
}
Expand Down
2 changes: 1 addition & 1 deletion docker/resource_docker_secret_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ func TestAccDockerSecret_labels(t *testing.T) {
resource "docker_secret" "foo" {
name = "foo-secret"
data = "Ymxhc2RzYmxhYmxhMTI0ZHNkd2VzZA=="
labels {
labels = {
"test1" = "foo"
"test2" = "bar"
}
Expand Down
Loading

0 comments on commit a789ce2

Please sign in to comment.