From 9683bf2a46f70b5d6f86a5aebee0dce623e7f6c4 Mon Sep 17 00:00:00 2001 From: Lang Martin Date: Fri, 29 Mar 2019 10:44:52 -0400 Subject: [PATCH] client, structs comments --- client/client.go | 4 ++++ nomad/structs/structs.go | 4 +++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/client/client.go b/client/client.go index dbbd11e2bb8..c55891a724b 100644 --- a/client/client.go +++ b/client/client.go @@ -1208,6 +1208,8 @@ func (c *Client) updateNodeFromFingerprint(response *fingerprint.FingerprintResp } // COMPAT(0.10): Remove in 0.10 + // update the response networks with the config + // if we still have node changes, merge them if response.Resources != nil { response.Resources.Networks = updateNetworks( c.config.Node.Resources.Networks, @@ -1219,6 +1221,8 @@ func (c *Client) updateNodeFromFingerprint(response *fingerprint.FingerprintResp } } + // update the response networks with the config + // if we still have node changes, merge them if response.NodeResources != nil { response.NodeResources.Networks = updateNetworks( c.config.Node.NodeResources.Networks, diff --git a/nomad/structs/structs.go b/nomad/structs/structs.go index e1fb8aa29f4..d18210cad8f 100644 --- a/nomad/structs/structs.go +++ b/nomad/structs/structs.go @@ -1803,7 +1803,7 @@ func (r *Resources) Equals(o *Resources) bool { type ResourceDevices []*RequestedDevice // COMPAT(0.10): Remove in 0.10 -// Equals ResourceDevices as set on Name +// Equals ResourceDevices as set keyed by Name func (d *ResourceDevices) Equals(o *ResourceDevices) bool { if d == nil && o == nil { return true @@ -2137,6 +2137,7 @@ func (r *RequestedDevice) Equals(o *RequestedDevice) bool { } // r.Constraints == o.Constraints, order sensitive + // REVIEW: should this be a set comparison? if len(r.Constraints) != len(o.Constraints) { return false } @@ -2338,6 +2339,7 @@ func (n *NodeResources) Equals(o *NodeResources) bool { return true } +// Equals equates Networks as a set func (n *Networks) Equals(o *Networks) bool { if n == o { return true