Added a warning message if disk attribute is non zero

This commit is contained in:
Diptanu Choudhury 2016-11-08 17:00:59 -08:00
parent 56ed1d3cd8
commit 7ea3efbd28
2 changed files with 18 additions and 0 deletions

View File

@ -167,6 +167,23 @@ func (c *RunCommand) Run(args []string) int {
return 1
}
// COMPAT 0.4.1 -> 0.5 Remove in 0.6
if apiJob.TaskGroups != nil {
OUTSIDE:
for _, tg := range apiJob.TaskGroups {
if tg.Tasks != nil {
for _, task := range tg.Tasks {
if task.Resources != nil {
if task.Resources.DiskMB > 0 {
c.Ui.Error("WARNING: disk attribute is deprecated in the resources block. See https://www.nomadproject.io/docs/job-specification/ephemeral_disk.html")
break OUTSIDE
}
}
}
}
}
}
if output {
req := api.RegisterJobRequest{Job: apiJob}
buf, err := json.MarshalIndent(req, "", " ")

View File

@ -973,6 +973,7 @@ func parseResources(result *structs.Resources, list *ast.ObjectList) error {
valid := []string{
"cpu",
"iops",
"disk",
"memory",
"network",
}