diff --git a/command/run.go b/command/run.go index c8fa5bade..e2e4f0f3a 100644 --- a/command/run.go +++ b/command/run.go @@ -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, "", " ") diff --git a/jobspec/parse.go b/jobspec/parse.go index f9910e4b5..f9defa7cf 100644 --- a/jobspec/parse.go +++ b/jobspec/parse.go @@ -973,6 +973,7 @@ func parseResources(result *structs.Resources, list *ast.ObjectList) error { valid := []string{ "cpu", "iops", + "disk", "memory", "network", }