diff --git a/client/driver/docker.go b/client/driver/docker.go index 53a0e4f92..6d3fd9816 100644 --- a/client/driver/docker.go +++ b/client/driver/docker.go @@ -176,7 +176,7 @@ func (d *DockerDriver) Validate(config map[string]interface{}) error { Type: fields.TypeString, }, "labels": &fields.FieldSchema{ - Type: fields.TypeMap, + Type: fields.TypeArray, }, "auth": &fields.FieldSchema{ Type: fields.TypeArray, diff --git a/jobspec/parse_test.go b/jobspec/parse_test.go index d8e059350..10374146e 100644 --- a/jobspec/parse_test.go +++ b/jobspec/parse_test.go @@ -91,6 +91,11 @@ func TestParse(t *testing.T) { User: "bob", Config: map[string]interface{}{ "image": "hashicorp/binstore", + "labels": []map[string]interface{}{ + map[string]interface{}{ + "FOO": "bar", + }, + }, }, Services: []*structs.Service{ { diff --git a/jobspec/test-fixtures/basic.hcl b/jobspec/test-fixtures/basic.hcl index 737a01264..835e53f07 100644 --- a/jobspec/test-fixtures/basic.hcl +++ b/jobspec/test-fixtures/basic.hcl @@ -47,6 +47,10 @@ job "binstore-storagelocker" { config { image = "hashicorp/binstore" + + labels { + FOO = "bar" + } } logs {