Skip to content

Commit

Permalink
client, structs comments
Browse files Browse the repository at this point in the history
  • Loading branch information
langmartin committed Mar 29, 2019
1 parent 628a0b1 commit 9683bf2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
4 changes: 4 additions & 0 deletions client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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,
Expand Down
4 changes: 3 additions & 1 deletion nomad/structs/structs.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
}
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 9683bf2

Please sign in to comment.