From 2de532dbdedf99a1f71f9a6fe2d64f7223bae4da Mon Sep 17 00:00:00 2001 From: Nick Ethier Date: Tue, 25 Aug 2020 15:42:45 -0400 Subject: [PATCH] website: add mbits and network deprecation notice --- nomad/structs/structs.go | 9 +++++++++ website/pages/docs/upgrade/upgrade-specific.mdx | 5 +++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/nomad/structs/structs.go b/nomad/structs/structs.go index f9bdc9df1..d1a21df38 100644 --- a/nomad/structs/structs.go +++ b/nomad/structs/structs.go @@ -6344,6 +6344,11 @@ func (tg *TaskGroup) Warnings(j *Job) error { } } + // Check for mbits network field + if len(tg.Networks) > 0 && tg.Networks[0].MBits > 0 { + mErr.Errors = append(mErr.Errors, fmt.Errorf("mbits has been deprecated as of Nomad 0.12.0. Please remove mbits from the network block")) + } + for _, t := range tg.Tasks { if err := t.Warnings(); err != nil { err = multierror.Prefix(err, fmt.Sprintf("Task %q:", t.Name)) @@ -7017,6 +7022,10 @@ func (t *Task) Warnings() error { mErr.Errors = append(mErr.Errors, fmt.Errorf("IOPS has been deprecated as of Nomad 0.9.0. Please remove IOPS from resource stanza.")) } + if t.Resources != nil && len(t.Resources.Networks) != 0 { + mErr.Errors = append(mErr.Errors, fmt.Errorf("task network resources have been deprecated as of Nomad 0.12.0. Please configure networking via group network block.")) + } + for idx, tmpl := range t.Templates { if err := tmpl.Warnings(); err != nil { err = multierror.Prefix(err, fmt.Sprintf("Template[%d]", idx)) diff --git a/website/pages/docs/upgrade/upgrade-specific.mdx b/website/pages/docs/upgrade/upgrade-specific.mdx index e018e92da..eaf3b5c23 100644 --- a/website/pages/docs/upgrade/upgrade-specific.mdx +++ b/website/pages/docs/upgrade/upgrade-specific.mdx @@ -162,8 +162,9 @@ v0.12.9. To work around the bug, use a relative path. ### `mbits` and Task Network Resource deprecation Starting in Nomad 0.12.0 the `mbits` field of the network resource block has -been deprecated. This is in part because we felt that `mbits` didn't -accurately account network bandwidth as a resource. +been deprecated and is no longer considered when making scheduling decisions. +This is in part because we felt that `mbits` didn't accurately account network +bandwidth as a resource. Additionally the use of the `network` block inside of a task's `resource` block is also deprecated. Users are advised to move their `network` block to the `group`