drivers: use consts for task handle version

This commit is contained in:
Nick Ethier
2019-01-16 21:52:31 -05:00
parent be81ecd5e6
commit 7d80fe286f
18 changed files with 80 additions and 33 deletions

View File

@@ -21,7 +21,16 @@ import (
"github.com/zclconf/go-cty/cty/msgpack"
)
const DriverHealthy = "Healthy"
const (
// DriverHealthy is the default health description that should be used
// if the driver is nominal
DriverHealthy = "Healthy"
// Pre09TaskHandleVersion is the version used to identify that the task
// handle is from a driver that existed before driver plugins (v0.9). The
// driver should take appropriate action to handle the old driver state.
Pre09TaskHandleVersion = 0
)
// DriverPlugin is the interface with drivers will implement. It is also
// implemented by a plugin client which proxies the calls to go-plugin. See

View File

@@ -448,7 +448,8 @@ enum TaskState {
// TaskHandle is created when starting a task and is used to recover task
message TaskHandle {
// Version is used by the driver to version the DriverState schema
// Version is used by the driver to version the DriverState schema.
// Version 0 is reserved by Nomad and should not be used.
int32 version = 1;
// Config is the TaskConfig for the task