Merge branch 'master' of github.com:terraform-providers/terraform-provider-docker

This commit is contained in:
Manuel Vogel 2018-08-06 14:21:39 +02:00
commit c346edd285
No known key found for this signature in database
GPG key ID: 533006C7B61DB1CE
3 changed files with 20 additions and 4 deletions

View file

@ -1,4 +1,8 @@
## 1.0.1 (Unreleased)
BUG FIXES
* Fixes empty strings on mapping from map to slice causes GH-81
## 1.0.0 (July 03, 2018)
NOTES:
@ -6,9 +10,9 @@ NOTES:
* The `links` property on `resource_docker_container` is now marked as deprecated [#47](https://github.com/terraform-providers/terraform-provider-docker/pull/47)
FEATURES:
* Add `swarm` capabilities ([#29](https://github.com/terraform-providers/terraform-provider-docker/issues/29)] [#40](https://github.com/terraform-providers/terraform-provider-docker/pull/40) with fixes [#66](https://github.com/terraform-providers/terraform-provider-docker/pull/66) up to Docker `18.03.1` and API Version `1.37` [[#64](https://github.com/terraform-providers/terraform-provider-docker/issues/64))
* Add `swarm` capabilities ([#29](https://github.com/terraform-providers/terraform-provider-docker/issues/29), [#40](https://github.com/terraform-providers/terraform-provider-docker/pull/40) which fixes [#66](https://github.com/terraform-providers/terraform-provider-docker/pull/66) up to Docker `18.03.1` and API Version `1.37` ([#64](https://github.com/terraform-providers/terraform-provider-docker/issues/64))
* Add ability to upload executable files [#55](https://github.com/terraform-providers/terraform-provider-docker/pull/55)
* Add support to attach devices to containers [[#30](https://github.com/terraform-providers/terraform-provider-docker/issues/30)] [#54](https://github.com/terraform-providers/terraform-provider-docker/pull/54)
* Add support to attach devices to containers [#30](https://github.com/terraform-providers/terraform-provider-docker/issues/30), [#54](https://github.com/terraform-providers/terraform-provider-docker/pull/54)
* Add Ulimits to containers [#35](https://github.com/terraform-providers/terraform-provider-docker/pull/35)
IMPROVEMENTS:

View file

@ -387,9 +387,11 @@ func mapTypeMapValsToString(typeMap map[string]interface{}) map[string]string {
// mapTypeMapValsToStringSlice maps a map to a slice with '=': e.g. foo = "bar" -> 'foo=bar'
func mapTypeMapValsToStringSlice(typeMap map[string]interface{}) []string {
mapped := make([]string, len(typeMap))
mapped := make([]string, 0)
for k, v := range typeMap {
mapped = append(mapped, k+"="+v.(string))
if len(k) > 0 {
mapped = append(mapped, k+"="+v.(string))
}
}
return mapped
}

View file

@ -14,6 +14,16 @@ import (
"github.com/hashicorp/terraform/terraform"
)
func TestMapTypeMapValsToStringSlice(t *testing.T) {
typeMap := make(map[string]interface{})
typeMap["foo"] = "bar"
typeMap[""] = ""
stringSlice := mapTypeMapValsToStringSlice(typeMap)
if len(stringSlice) != 1 {
t.Fatalf("slice should have length 1 but has %v", len(stringSlice))
}
}
func TestAccDockerContainer_basic(t *testing.T) {
var c types.ContainerJSON
resource.Test(t, resource.TestCase{