From 49fbaace5298d5ccf031eb7ebec93906e1d468b5 Mon Sep 17 00:00:00 2001 From: Lang Martin Date: Wed, 27 Mar 2019 11:03:13 -0400 Subject: [PATCH] add COMPAT(0.10): Remove in 0.10 notes to impl for structs.Resources --- nomad/structs/structs.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/nomad/structs/structs.go b/nomad/structs/structs.go index 7658202feb3..af5421a47bb 100644 --- a/nomad/structs/structs.go +++ b/nomad/structs/structs.go @@ -1771,6 +1771,7 @@ func (r *Resources) Validate() error { } // Merge merges this resource with another resource. +// COMPAT(0.10): Remove in 0.10 func (r *Resources) Merge(other *Resources) { if other.CPU != 0 { r.CPU = other.CPU @@ -1790,6 +1791,7 @@ func (r *Resources) Merge(other *Resources) { } // Equals deeply equates the value of this resource with another +// COMPAT(0.10): Remove in 0.10 func (r *Resources) Equals(o *Resources) bool { if r == nil && o == nil { return true @@ -1814,6 +1816,7 @@ func (r *Resources) Equals(o *Resources) bool { return false } +// COMPAT(0.10): Remove in 0.10 func (r *Resources) Canonicalize() { // Ensure that an empty and nil slices are treated the same to avoid scheduling // problems since we use reflect DeepEquals. @@ -1832,6 +1835,7 @@ func (r *Resources) Canonicalize() { // MeetsMinResources returns an error if the resources specified are less than // the minimum allowed. // This is based on the minimums defined in the Resources type +// COMPAT(0.10): Remove in 0.10 func (r *Resources) MeetsMinResources() error { var mErr multierror.Error minResources := MinResources() @@ -1880,6 +1884,7 @@ func (r *Resources) Copy() *Resources { } // NetIndex finds the matching net index using device name +// COMPAT(0.10): Remove in 0.10 func (r *Resources) NetIndex(n *NetworkResource) int { return r.Networks.NetIndex(n) } @@ -1887,6 +1892,7 @@ func (r *Resources) NetIndex(n *NetworkResource) int { // Superset checks if one set of resources is a superset // of another. This ignores network resources, and the NetworkIndex // should be used for that. +// COMPAT(0.10): Remove in 0.10 func (r *Resources) Superset(other *Resources) (bool, string) { if r.CPU < other.CPU { return false, "cpu" @@ -1902,6 +1908,7 @@ func (r *Resources) Superset(other *Resources) (bool, string) { // Add adds the resources of the delta to this, potentially // returning an error if not possible. +// COMPAT(0.10): Remove in 0.10 func (r *Resources) Add(delta *Resources) error { if delta == nil { return nil @@ -1922,6 +1929,7 @@ func (r *Resources) Add(delta *Resources) error { return nil } +// COMPAT(0.10): Remove in 0.10 func (r *Resources) GoString() string { return fmt.Sprintf("*%#v", *r) }