diff --git a/client/state/08types.go b/client/state/08types.go index c10a1a90b..3d4cf209d 100644 --- a/client/state/08types.go +++ b/client/state/08types.go @@ -3,6 +3,7 @@ package state import ( "encoding/json" "fmt" + "strings" "github.com/hashicorp/nomad/client/allocrunner/taskrunner/state" "github.com/hashicorp/nomad/nomad/structs" @@ -44,7 +45,16 @@ type taskRunnerState08 struct { //CreatedResources *driver.CreatedResources } -type taskRunnerHandle08 struct { +type TaskRunnerHandle08 struct { + // Docker specific handle info + ContainerID string `json:"ContainerID"` + Image string `json:"Image"` + + // LXC specific handle info + ContainerName string `json:"ContainerName"` + LxcPath string `json:"LxcPath"` + + // Executor reattach config PluginConfig struct { Pid int `json:"Pid"` AddrNet string `json:"AddrNet"` @@ -52,7 +62,7 @@ type taskRunnerHandle08 struct { } `json:"PluginConfig"` } -func (t *taskRunnerHandle08) reattachConfig() *shared.ReattachConfig { +func (t *TaskRunnerHandle08) ReattachConfig() *shared.ReattachConfig { return &shared.ReattachConfig{ Network: t.PluginConfig.AddrNet, Addr: t.PluginConfig.AddrName, @@ -90,18 +100,30 @@ func (t *taskRunnerState08) Upgrade(allocID, taskName string) (*state.LocalState ls.TaskHandle.State = drivers.TaskStateUnknown - // A ReattachConfig to the pre09 executor is sent - var raw []byte - var handle taskRunnerHandle08 - if err := json.Unmarshal([]byte(t.HandleID), &handle); err != nil { - return nil, fmt.Errorf("failed to decode 0.8 driver state: %v", err) - } - raw, err := json.Marshal(handle.reattachConfig()) - if err != nil { - return nil, fmt.Errorf("failed to encode updated driver state: %v", err) + // The docker driver prefixed the handle with 'DOCKER:' + // Strip so that it can be unmarshalled + data := t.HandleID + if strings.HasPrefix(data, "DOCKER:") { + data = data[7:] } - ls.TaskHandle.DriverState = raw + // The pre09 driver handle ID is given to the driver. It is unmarshalled + // here to check for errors + if _, err := UnmarshalPre09HandleID([]byte(data)); err != nil { + return nil, err + } + + ls.TaskHandle.DriverState = []byte(data) return ls, nil } + +// UnmarshalPre09HandleID decodes the pre09 json encoded handle ID +func UnmarshalPre09HandleID(raw []byte) (*TaskRunnerHandle08, error) { + var handle TaskRunnerHandle08 + if err := json.Unmarshal(raw, &handle); err != nil { + return nil, fmt.Errorf("failed to decode 0.8 driver state: %v", err) + } + + return &handle, nil +} diff --git a/drivers/docker/driver.go b/drivers/docker/driver.go index 674c716b9..e3059fe62 100644 --- a/drivers/docker/driver.go +++ b/drivers/docker/driver.go @@ -118,6 +118,11 @@ func (d *Driver) RecoverTask(handle *drivers.TaskHandle) error { return nil } + // COMPAT(0.10): pre 0.9 upgrade path check + if handle.Version == 0 { + return d.recoverPre09Task(handle) + } + var handleState taskHandleState if err := handle.GetDriverState(&handleState); err != nil { return fmt.Errorf("failed to decode driver task state: %v", err) diff --git a/drivers/docker/driver_pre09.go b/drivers/docker/driver_pre09.go new file mode 100644 index 000000000..b227feff8 --- /dev/null +++ b/drivers/docker/driver_pre09.go @@ -0,0 +1,77 @@ +package docker + +import ( + "fmt" + + "github.com/hashicorp/nomad/client/state" + "github.com/hashicorp/nomad/drivers/docker/docklog" + "github.com/hashicorp/nomad/drivers/shared/executor" + "github.com/hashicorp/nomad/helper/uuid" + "github.com/hashicorp/nomad/plugins/drivers" + "github.com/hashicorp/nomad/plugins/shared" +) + +func (d *Driver) recoverPre09Task(h *drivers.TaskHandle) error { + handle, err := state.UnmarshalPre09HandleID(h.DriverState) + if err != nil { + return fmt.Errorf("failed to decode pre09 driver handle: %v", err) + } + + reattach, err := shared.ReattachConfigToGoPlugin(handle.ReattachConfig()) + if err != nil { + return fmt.Errorf("failed to decode reattach config from pre09 handle: %v", err) + } + + h.Config.ID = fmt.Sprintf("pre09-%s", uuid.Generate()) + exec, pluginClient, err := executor.ReattachToPre09Executor(reattach, + d.logger.With("task_name", h.Config.Name, "alloc_id", h.Config.AllocID)) + if err != nil { + d.logger.Error("failed to reattach to executor", "error", err, "task_name", h.Config.Name) + return fmt.Errorf("failed to reattach to executor: %v", err) + } + + client, _, err := d.dockerClients() + if err != nil { + return fmt.Errorf("failed to get docker client: %v", err) + } + + container, err := client.InspectContainer(handle.ContainerID) + if err != nil { + return fmt.Errorf("failed to inspect container for id %q: %v", handle.ContainerID, err) + } + + th := &taskHandle{ + client: client, + waitClient: waitClient, + dlogger: &executorDockerLoggerShim{exec: exec}, + dloggerPluginClient: pluginClient, + logger: d.logger.With("container_id", container.ID), + task: h.Config, + containerID: container.ID, + containerImage: container.Image, + doneCh: make(chan bool), + waitCh: make(chan struct{}), + removeContainerOnExit: d.config.GC.Container, + } + + d.tasks.Set(h.Config.ID, th) + go th.run() + return nil +} + +// executorDockerLoggerShim is used by upgraded tasks as the docker logger. When +// the task exits, the Stop() func of the docker logger is called, this shim +// will proxy that call to the executor Shutdown() func which will stop the +// syslog server started by the pre09 executor +type executorDockerLoggerShim struct { + exec executor.Executor +} + +func (e *executorDockerLoggerShim) Start(*docklog.StartOpts) error { return nil } +func (e *executorDockerLoggerShim) Stop() error { + if err := e.exec.Shutdown("", 0); err != nil { + return err + } + + return nil +} diff --git a/drivers/exec/driver.go b/drivers/exec/driver.go index 91e3f548b..2f8880895 100644 --- a/drivers/exec/driver.go +++ b/drivers/exec/driver.go @@ -2,7 +2,6 @@ package exec import ( "context" - "encoding/json" "fmt" "os" "path/filepath" @@ -259,19 +258,9 @@ func (d *Driver) RecoverTask(handle *drivers.TaskHandle) error { return fmt.Errorf("handle cannot be nil") } - // pre 0.9 upgrade path check + // COMPAT(0.10): pre 0.9 upgrade path check if handle.Version == 0 { - var reattach shared.ReattachConfig - d.logger.Debug("parsing pre09 driver state", "state", string(handle.DriverState)) - if err := json.Unmarshal(handle.DriverState, &reattach); err != nil { - return err - } - - reattachConfig, err := shared.ReattachConfigToGoPlugin(&reattach) - if err != nil { - return err - } - return d.recoverPre09Task(handle.Config, reattachConfig) + return d.recoverPre09Task(handle) } // If already attached to handle there's nothing to recover. diff --git a/drivers/exec/driver_pre09.go b/drivers/exec/driver_pre09.go index 982123845..2f7f65e3f 100644 --- a/drivers/exec/driver_pre09.go +++ b/drivers/exec/driver_pre09.go @@ -4,33 +4,44 @@ import ( "fmt" "time" - plugin "github.com/hashicorp/go-plugin" + "github.com/hashicorp/nomad/client/state" "github.com/hashicorp/nomad/drivers/shared/executor" "github.com/hashicorp/nomad/helper/uuid" "github.com/hashicorp/nomad/plugins/drivers" + "github.com/hashicorp/nomad/plugins/shared" ) -func (d *Driver) recoverPre09Task(config *drivers.TaskConfig, reattach *plugin.ReattachConfig) error { - config.ID = fmt.Sprintf("pre09-%s", uuid.Generate()) - exec, pluginClient, err := executor.ReattachToPre09Executor(reattach, - d.logger.With("task_name", config.Name, "alloc_id", config.AllocID)) +func (d *Driver) recoverPre09Task(h *drivers.TaskHandle) error { + handle, err := state.UnmarshalPre09HandleID(h.DriverState) if err != nil { - d.logger.Error("failed to reattach to executor", "error", err, "task_name", config.Name) + return fmt.Errorf("failed to decode pre09 driver handle: %v", err) + } + + reattach, err := shared.ReattachConfigToGoPlugin(handle.ReattachConfig()) + if err != nil { + return fmt.Errorf("failed to decode reattach config from pre09 handle: %v", err) + } + + h.Config.ID = fmt.Sprintf("pre09-%s", uuid.Generate()) + exec, pluginClient, err := executor.ReattachToPre09Executor(reattach, + d.logger.With("task_name", h.Config.Name, "alloc_id", h.Config.AllocID)) + if err != nil { + d.logger.Error("failed to reattach to executor", "error", err, "task_name", h.Config.Name) return fmt.Errorf("failed to reattach to executor: %v", err) } - h := &taskHandle{ + th := &taskHandle{ exec: exec, pid: reattach.Pid, pluginClient: pluginClient, - taskConfig: config, + taskConfig: h.Config, procState: drivers.TaskStateRunning, startedAt: time.Now(), exitResult: &drivers.ExitResult{}, } - d.tasks.Set(config.ID, h) + d.tasks.Set(h.Config.ID, th) - go h.run() + go th.run() return nil } diff --git a/drivers/java/driver.go b/drivers/java/driver.go index 433539e9d..6c5c2e13e 100644 --- a/drivers/java/driver.go +++ b/drivers/java/driver.go @@ -2,7 +2,6 @@ package java import ( "context" - "encoding/json" "fmt" "os" "os/exec" @@ -247,19 +246,9 @@ func (d *Driver) RecoverTask(handle *drivers.TaskHandle) error { return fmt.Errorf("handle cannot be nil") } - // pre 0.9 upgrade path check + // COMPAT(0.10): pre 0.9 upgrade path check if handle.Version == 0 { - var reattach shared.ReattachConfig - d.logger.Debug("parsing pre09 driver state", "state", string(handle.DriverState)) - if err := json.Unmarshal(handle.DriverState, &reattach); err != nil { - return err - } - - reattachConfig, err := shared.ReattachConfigToGoPlugin(&reattach) - if err != nil { - return err - } - return d.recoverPre09Task(handle.Config, reattachConfig) + return d.recoverPre09Task(handle) } // If already attached to handle there's nothing to recover. diff --git a/drivers/java/driver_pre09.go b/drivers/java/driver_pre09.go index 58ba66493..a8061e5e5 100644 --- a/drivers/java/driver_pre09.go +++ b/drivers/java/driver_pre09.go @@ -4,33 +4,44 @@ import ( "fmt" "time" - plugin "github.com/hashicorp/go-plugin" + "github.com/hashicorp/nomad/client/state" "github.com/hashicorp/nomad/drivers/shared/executor" "github.com/hashicorp/nomad/helper/uuid" "github.com/hashicorp/nomad/plugins/drivers" + "github.com/hashicorp/nomad/plugins/shared" ) -func (d *Driver) recoverPre09Task(config *drivers.TaskConfig, reattach *plugin.ReattachConfig) error { - config.ID = fmt.Sprintf("pre09-%s", uuid.Generate()) - exec, pluginClient, err := executor.ReattachToPre09Executor(reattach, - d.logger.With("task_name", config.Name, "alloc_id", config.AllocID)) +func (d *Driver) recoverPre09Task(h *drivers.TaskHandle) error { + handle, err := state.UnmarshalPre09HandleID(h.DriverState) if err != nil { - d.logger.Error("failed to reattach to executor", "error", err, "task_name", config.Name) + return fmt.Errorf("failed to decode pre09 driver handle: %v", err) + } + + reattach, err := shared.ReattachConfigToGoPlugin(handle.ReattachConfig()) + if err != nil { + return fmt.Errorf("failed to decode reattach config from pre09 handle: %v", err) + } + + h.Config.ID = fmt.Sprintf("pre09-%s", uuid.Generate()) + exec, pluginClient, err := executor.ReattachToPre09Executor(reattach, + d.logger.With("task_name", h.Config.Name, "alloc_id", h.Config.AllocID)) + if err != nil { + d.logger.Error("failed to reattach to executor", "error", err, "task_name", h.Config.Name) return fmt.Errorf("failed to reattach to executor: %v", err) } - h := &taskHandle{ + th := &taskHandle{ exec: exec, pid: reattach.Pid, pluginClient: pluginClient, - taskConfig: config, + taskConfig: h.Config, procState: drivers.TaskStateRunning, startedAt: time.Now(), exitResult: &drivers.ExitResult{}, } - d.tasks.Set(config.ID, h) + d.tasks.Set(h.Config.ID, th) - go h.run() + go th.run() return nil } diff --git a/drivers/qemu/driver.go b/drivers/qemu/driver.go index 7d2420400..8183222c3 100644 --- a/drivers/qemu/driver.go +++ b/drivers/qemu/driver.go @@ -2,7 +2,6 @@ package qemu import ( "context" - "encoding/json" "errors" "fmt" "net" @@ -245,19 +244,9 @@ func (d *Driver) RecoverTask(handle *drivers.TaskHandle) error { return fmt.Errorf("error: handle cannot be nil") } - // pre 0.9 upgrade path check + // COMPAT(0.10): pre 0.9 upgrade path check if handle.Version == 0 { - var reattach shared.ReattachConfig - d.logger.Debug("parsing pre09 driver state", "state", string(handle.DriverState)) - if err := json.Unmarshal(handle.DriverState, &reattach); err != nil { - return err - } - - reattachConfig, err := shared.ReattachConfigToGoPlugin(&reattach) - if err != nil { - return err - } - return d.recoverPre09Task(handle.Config, reattachConfig) + return d.recoverPre09Task(handle) } // If already attached to handle there's nothing to recover. diff --git a/drivers/qemu/driver_pre09.go b/drivers/qemu/driver_pre09.go index 152b3f59a..02b4e10b2 100644 --- a/drivers/qemu/driver_pre09.go +++ b/drivers/qemu/driver_pre09.go @@ -4,33 +4,44 @@ import ( "fmt" "time" - plugin "github.com/hashicorp/go-plugin" + "github.com/hashicorp/nomad/client/state" "github.com/hashicorp/nomad/drivers/shared/executor" "github.com/hashicorp/nomad/helper/uuid" "github.com/hashicorp/nomad/plugins/drivers" + "github.com/hashicorp/nomad/plugins/shared" ) -func (d *Driver) recoverPre09Task(config *drivers.TaskConfig, reattach *plugin.ReattachConfig) error { - config.ID = fmt.Sprintf("pre09-%s", uuid.Generate()) - exec, pluginClient, err := executor.ReattachToPre09Executor(reattach, - d.logger.With("task_name", config.Name, "alloc_id", config.AllocID)) +func (d *Driver) recoverPre09Task(h *drivers.TaskHandle) error { + handle, err := state.UnmarshalPre09HandleID(h.DriverState) if err != nil { - d.logger.Error("failed to reattach to executor", "error", err, "task_name", config.Name) + return fmt.Errorf("failed to decode pre09 driver handle: %v", err) + } + + reattach, err := shared.ReattachConfigToGoPlugin(handle.ReattachConfig()) + if err != nil { + return fmt.Errorf("failed to decode reattach config from pre09 handle: %v", err) + } + + h.Config.ID = fmt.Sprintf("pre09-%s", uuid.Generate()) + exec, pluginClient, err := executor.ReattachToPre09Executor(reattach, + d.logger.With("task_name", h.Config.Name, "alloc_id", h.Config.AllocID)) + if err != nil { + d.logger.Error("failed to reattach to executor", "error", err, "task_name", h.Config.Name) return fmt.Errorf("failed to reattach to executor: %v", err) } - h := &taskHandle{ + th := &taskHandle{ exec: exec, pid: reattach.Pid, pluginClient: pluginClient, - taskConfig: config, + taskConfig: h.Config, procState: drivers.TaskStateRunning, startedAt: time.Now(), exitResult: &drivers.ExitResult{}, } - d.tasks.Set(config.ID, h) + d.tasks.Set(h.Config.ID, th) - go h.run() + go th.run() return nil } diff --git a/drivers/rawexec/driver.go b/drivers/rawexec/driver.go index 9a3aec507..dc6a5a71b 100644 --- a/drivers/rawexec/driver.go +++ b/drivers/rawexec/driver.go @@ -2,7 +2,6 @@ package rawexec import ( "context" - "encoding/json" "fmt" "os" "path/filepath" @@ -251,19 +250,9 @@ func (d *Driver) RecoverTask(handle *drivers.TaskHandle) error { return fmt.Errorf("handle cannot be nil") } - // pre 0.9 upgrade path check + // COMPAT(0.10): pre 0.9 upgrade path check if handle.Version == 0 { - var reattach shared.ReattachConfig - d.logger.Debug("parsing pre09 driver state", "state", string(handle.DriverState)) - if err := json.Unmarshal(handle.DriverState, &reattach); err != nil { - return err - } - - reattachConfig, err := shared.ReattachConfigToGoPlugin(&reattach) - if err != nil { - return err - } - return d.recoverPre09Task(handle.Config, reattachConfig) + return d.recoverPre09Task(handle) } // If already attached to handle there's nothing to recover. diff --git a/drivers/rawexec/driver_pre09.go b/drivers/rawexec/driver_pre09.go index 9a60842de..72ddf8db3 100644 --- a/drivers/rawexec/driver_pre09.go +++ b/drivers/rawexec/driver_pre09.go @@ -4,33 +4,44 @@ import ( "fmt" "time" - plugin "github.com/hashicorp/go-plugin" + "github.com/hashicorp/nomad/client/state" "github.com/hashicorp/nomad/drivers/shared/executor" "github.com/hashicorp/nomad/helper/uuid" "github.com/hashicorp/nomad/plugins/drivers" + "github.com/hashicorp/nomad/plugins/shared" ) -func (d *Driver) recoverPre09Task(config *drivers.TaskConfig, reattach *plugin.ReattachConfig) error { - config.ID = fmt.Sprintf("pre09-%s", uuid.Generate()) - exec, pluginClient, err := executor.ReattachToPre09Executor(reattach, - d.logger.With("task_name", config.Name, "alloc_id", config.AllocID)) +func (d *Driver) recoverPre09Task(h *drivers.TaskHandle) error { + handle, err := state.UnmarshalPre09HandleID(h.DriverState) if err != nil { - d.logger.Error("failed to reattach to executor", "error", err, "task_name", config.Name) + return fmt.Errorf("failed to decode pre09 driver handle: %v", err) + } + + reattach, err := shared.ReattachConfigToGoPlugin(handle.ReattachConfig()) + if err != nil { + return fmt.Errorf("failed to decode reattach config from pre09 handle: %v", err) + } + + h.Config.ID = fmt.Sprintf("pre09-%s", uuid.Generate()) + exec, pluginClient, err := executor.ReattachToPre09Executor(reattach, + d.logger.With("task_name", h.Config.Name, "alloc_id", h.Config.AllocID)) + if err != nil { + d.logger.Error("failed to reattach to executor", "error", err, "task_name", h.Config.Name) return fmt.Errorf("failed to reattach to executor: %v", err) } - h := &taskHandle{ + th := &taskHandle{ exec: exec, pid: reattach.Pid, pluginClient: pluginClient, - taskConfig: config, + taskConfig: h.Config, procState: drivers.TaskStateRunning, startedAt: time.Now(), exitResult: &drivers.ExitResult{}, } - d.tasks.Set(config.ID, h) + d.tasks.Set(h.Config.ID, th) - go h.run() + go th.run() return nil } diff --git a/drivers/rkt/driver.go b/drivers/rkt/driver.go index e6c1a2225..6a28fd9f2 100644 --- a/drivers/rkt/driver.go +++ b/drivers/rkt/driver.go @@ -358,19 +358,9 @@ func (d *Driver) RecoverTask(handle *drivers.TaskHandle) error { return fmt.Errorf("error: handle cannot be nil") } - // pre 0.9 upgrade path check + // COMPAT(0.10): pre 0.9 upgrade path check if handle.Version == 0 { - var reattach shared.ReattachConfig - d.logger.Debug("parsing pre09 driver state", "state", string(handle.DriverState)) - if err := json.Unmarshal(handle.DriverState, &reattach); err != nil { - return err - } - - reattachConfig, err := shared.ReattachConfigToGoPlugin(&reattach) - if err != nil { - return err - } - return d.recoverPre09Task(handle.Config, reattachConfig) + return d.recoverPre09Task(handle) } // If already attached to handle there's nothing to recover. diff --git a/drivers/rkt/driver_pre09.go b/drivers/rkt/driver_pre09.go index 6695f6e38..7bdea1245 100644 --- a/drivers/rkt/driver_pre09.go +++ b/drivers/rkt/driver_pre09.go @@ -4,33 +4,44 @@ import ( "fmt" "time" - plugin "github.com/hashicorp/go-plugin" + "github.com/hashicorp/nomad/client/state" "github.com/hashicorp/nomad/drivers/shared/executor" "github.com/hashicorp/nomad/helper/uuid" "github.com/hashicorp/nomad/plugins/drivers" + "github.com/hashicorp/nomad/plugins/shared" ) -func (d *Driver) recoverPre09Task(config *drivers.TaskConfig, reattach *plugin.ReattachConfig) error { - config.ID = fmt.Sprintf("pre09-%s", uuid.Generate()) - exec, pluginClient, err := executor.ReattachToPre09Executor(reattach, - d.logger.With("task_name", config.Name, "alloc_id", config.AllocID)) +func (d *Driver) recoverPre09Task(h *drivers.TaskHandle) error { + handle, err := state.UnmarshalPre09HandleID(h.DriverState) if err != nil { - d.logger.Error("failed to reattach to executor", "error", err, "task_name", config.Name) + return fmt.Errorf("failed to decode pre09 driver handle: %v", err) + } + + reattach, err := shared.ReattachConfigToGoPlugin(handle.ReattachConfig()) + if err != nil { + return fmt.Errorf("failed to decode reattach config from pre09 handle: %v", err) + } + + h.Config.ID = fmt.Sprintf("pre09-%s", uuid.Generate()) + exec, pluginClient, err := executor.ReattachToPre09Executor(reattach, + d.logger.With("task_name", h.Config.Name, "alloc_id", h.Config.AllocID)) + if err != nil { + d.logger.Error("failed to reattach to executor", "error", err, "task_name", h.Config.Name) return fmt.Errorf("failed to reattach to executor: %v", err) } - h := &taskHandle{ + th := &taskHandle{ exec: exec, pid: reattach.Pid, pluginClient: pluginClient, - taskConfig: config, + taskConfig: h.Config, procState: drivers.TaskStateRunning, startedAt: time.Now(), exitResult: &drivers.ExitResult{}, } - d.tasks.Set(config.ID, h) + d.tasks.Set(h.Config.ID, th) - go h.run() + go th.run() return nil } diff --git a/e2e/e2e_test.go b/e2e/e2e_test.go index f6588ed17..02d549aa2 100644 --- a/e2e/e2e_test.go +++ b/e2e/e2e_test.go @@ -6,6 +6,7 @@ import ( _ "github.com/hashicorp/nomad/e2e/affinities" _ "github.com/hashicorp/nomad/e2e/consultemplate" _ "github.com/hashicorp/nomad/e2e/example" + _ "github.com/hashicorp/nomad/e2e/nomad09upgrade" _ "github.com/hashicorp/nomad/e2e/spread" _ "github.com/hashicorp/nomad/e2e/taskevents" ) diff --git a/e2e/nomad09upgrade/docker.nomad b/e2e/nomad09upgrade/docker.nomad index 99ef97930..0fee0a47f 100644 --- a/e2e/nomad09upgrade/docker.nomad +++ b/e2e/nomad09upgrade/docker.nomad @@ -6,8 +6,7 @@ job "sleep" { driver = "docker" config { - image = "busybox" - args = ["sleep", "10000"] + image = "redis" } resources { diff --git a/e2e/nomad09upgrade/upgrade.go b/e2e/nomad09upgrade/upgrade.go index 800301101..2563c75ce 100644 --- a/e2e/nomad09upgrade/upgrade.go +++ b/e2e/nomad09upgrade/upgrade.go @@ -220,7 +220,7 @@ func (tc *UpgradePathTC) TestRawExecTaskUpgrade(f *framework.F) { ver := ver f.T().Run(ver, func(t *testing.T) { t.Parallel() - tc.testUpgradeForJob(t, ver, "rawexec.nomad") + tc.testUpgradeForJob(t, ver, "nomad09upgrade/rawexec.nomad") }) } } @@ -230,7 +230,17 @@ func (tc *UpgradePathTC) TestExecTaskUpgrade(f *framework.F) { ver := ver f.T().Run(ver, func(t *testing.T) { t.Parallel() - tc.testUpgradeForJob(t, ver, "exec.nomad") + tc.testUpgradeForJob(t, ver, "nomad09upgrade/exec.nomad") + }) + } +} + +func (tc *UpgradePathTC) TestDockerTaskUpgrade(f *framework.F) { + for _, ver := range nomadVersions { + ver := ver + f.T().Run(ver, func(t *testing.T) { + t.Parallel() + tc.testUpgradeForJob(t, ver, "nomad09upgrade/docker.nomad") }) } }