mirror of
https://github.com/kreuzwerker/terraform-provider-docker.git
synced 2025-12-22 07:39:35 -05:00
fix: Set correct default network driver and fix a test (#677)
* fix: Set correct default network driver and fix a test * fix: Update used google_containers/pause image tag --------- Co-authored-by: Martin Wentzel <junker@monoceres.uberspace.de>
This commit is contained in:
parent
4e6ef4b2e6
commit
f0dd96dbcd
5 changed files with 7 additions and 16 deletions
|
|
@ -729,19 +729,10 @@ func resourceDockerContainer() *schema.Resource {
|
||||||
|
|
||||||
"network_mode": {
|
"network_mode": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Description: "Network mode of the container.",
|
Description: "Network mode of the container. See https://docs.docker.com/engine/network/ for more information.",
|
||||||
Optional: true,
|
Optional: true,
|
||||||
ForceNew: true,
|
ForceNew: true,
|
||||||
DiffSuppressFunc: func(k, oldV, newV string, d *schema.ResourceData) bool {
|
Default: "bridge",
|
||||||
// treat "" as "default", which is Docker's default value
|
|
||||||
if oldV == "" {
|
|
||||||
oldV = "default"
|
|
||||||
}
|
|
||||||
if newV == "" {
|
|
||||||
newV = "default"
|
|
||||||
}
|
|
||||||
return oldV == newV
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
|
|
||||||
"networks_advanced": {
|
"networks_advanced": {
|
||||||
|
|
|
||||||
|
|
@ -162,12 +162,12 @@ func TestAccDockerImage_private(t *testing.T) {
|
||||||
|
|
||||||
testCheckImageInspect := func(*terraform.State) error {
|
testCheckImageInspect := func(*terraform.State) error {
|
||||||
if len(i.RepoTags) != 1 ||
|
if len(i.RepoTags) != 1 ||
|
||||||
i.RepoTags[0] != "gcr.io:443/google_containers/pause:0.8.0" {
|
i.RepoTags[0] != "gcr.io:443/google_containers/pause:1.0" {
|
||||||
return fmt.Errorf("Image RepoTags is wrong: %v", i.RepoTags)
|
return fmt.Errorf("Image RepoTags is wrong: %v", i.RepoTags)
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(i.RepoDigests) != 1 ||
|
if len(i.RepoDigests) != 1 ||
|
||||||
i.RepoDigests[0] != "gcr.io:443/google_containers/pause@sha256:bbeaef1d40778579b7b86543fe03e1ec041428a50d21f7a7b25630e357ec9247" {
|
i.RepoDigests[0] != "gcr.io:443/google_containers/pause@sha256:a78c2d6208eff9b672de43f880093100050983047b7b0afe0217d3656e1b0d5f" {
|
||||||
return fmt.Errorf("Image RepoDigests is wrong: %v", i.RepoDigests)
|
return fmt.Errorf("Image RepoDigests is wrong: %v", i.RepoDigests)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,3 @@
|
||||||
data "docker_registry_image" "bar" {
|
data "docker_registry_image" "bar" {
|
||||||
name = "gcr.io:443/google_containers/pause:0.8.0"
|
name = "gcr.io:443/google_containers/pause:1.0"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@ resource "docker_network" "test" {
|
||||||
}
|
}
|
||||||
|
|
||||||
ipam_config {
|
ipam_config {
|
||||||
subnet = "fd00::1/64"
|
subnet = "fd00::/64"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
resource "docker_image" "foo" {
|
resource "docker_image" "foo" {
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,3 @@
|
||||||
resource "docker_image" "foobar" {
|
resource "docker_image" "foobar" {
|
||||||
name = "gcr.io:443/google_containers/pause:0.8.0"
|
name = "gcr.io:443/google_containers/pause:1.0"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue