From 4eb0b84181a513259c35b5705867a95e429ba204 Mon Sep 17 00:00:00 2001 From: Michael Schurter Date: Wed, 23 Nov 2016 14:37:09 -0800 Subject: [PATCH 1/4] Fix rkt volumes I forgot to validate the volumes field! --- client/driver/rkt.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/client/driver/rkt.go b/client/driver/rkt.go index 4225d57a7f5..91df6e9cd12 100644 --- a/client/driver/rkt.go +++ b/client/driver/rkt.go @@ -136,6 +136,9 @@ func (d *RktDriver) Validate(config map[string]interface{}) error { "debug": &fields.FieldSchema{ Type: fields.TypeBool, }, + "volumes": &fields.FieldSchema{ + Type: fields.TypeArray, + }, }, } From 78a0c1e4ee7c6d2e49183556ef0983c76350cb52 Mon Sep 17 00:00:00 2001 From: Michael Schurter Date: Mon, 28 Nov 2016 11:02:22 -0800 Subject: [PATCH 2/4] Add changelog entry for #2027 --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index bc9174a5b1a..efeb5d71501 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ BUG FIXES: * client: Fix race on StreamFramer Destroy which would cause a panic [GH-2007] * driver/docker: Make container exist errors non-retriable by task runner [GH-2033] + * driver/rkt: Fix validation of rkt volumes [GH-2027] ## 0.5.0 (November 16, 2016) From c8dfe6ced7eb5844228c1a07efa8632118c055ac Mon Sep 17 00:00:00 2001 From: Michael Schurter Date: Wed, 23 Nov 2016 14:38:47 -0800 Subject: [PATCH 3/4] rkt: Support host and none dns options Fixes #2025 --- client/driver/rkt.go | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/client/driver/rkt.go b/client/driver/rkt.go index 91df6e9cd12..8e100dd3c63 100644 --- a/client/driver/rkt.go +++ b/client/driver/rkt.go @@ -309,13 +309,18 @@ func (d *RktDriver) Start(ctx *ExecContext, task *structs.Task) (DriverHandle, e cmdArgs = append(cmdArgs, fmt.Sprintf("--cpu=%vm", int64(task.Resources.CPU))) // Add DNS servers - for _, ip := range driverConfig.DNSServers { - if err := net.ParseIP(ip); err == nil { - msg := fmt.Errorf("invalid ip address for container dns server %q", ip) - d.logger.Printf("[DEBUG] driver.rkt: %v", msg) - return nil, msg - } else { - cmdArgs = append(cmdArgs, fmt.Sprintf("--dns=%s", ip)) + if len(driverConfig.DNSServers) == 1 && (driverConfig.DNSServers[0] == "host" || driverConfig.DNSServers[0] == "none") { + // Special case single item lists with the special values "host" or "none" + cmdArgs = append(cmdArgs, fmt.Sprintf("--dns=%s", driverConfig.DNSServers[0])) + } else { + for _, ip := range driverConfig.DNSServers { + if err := net.ParseIP(ip); err == nil { + msg := fmt.Errorf("invalid ip address for container dns server %q", ip) + d.logger.Printf("[DEBUG] driver.rkt: %v", msg) + return nil, msg + } else { + cmdArgs = append(cmdArgs, fmt.Sprintf("--dns=%s", ip)) + } } } From ab57d3bd1129cd6e8982b2580af5d33893f5e961 Mon Sep 17 00:00:00 2001 From: Michael Schurter Date: Mon, 28 Nov 2016 11:04:14 -0800 Subject: [PATCH 4/4] Add changelog entry for #2028 --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index efeb5d71501..71b61b8f872 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,8 @@ ## 0.5.1 (Unreleased) +IMPROVEMENTS: + * driver/rkt: Support rkt's `--dns=host` and `--dns=none` options [GH-2028] + BUG FIXES: * agent/config: Fix use of IPv6 addresses [GH-2036] * cli: Improve parsing error when a job without a name is specified [GH-2030]