Skip to content

Commit

Permalink
go style; update comments
Browse files Browse the repository at this point in the history
  • Loading branch information
chelseakomlo committed Mar 1, 2018
1 parent ca8e650 commit e5fc8db
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 3 deletions.
2 changes: 2 additions & 0 deletions client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -1016,6 +1016,8 @@ func (c *Client) updateNodeFromFingerprint(response *cstructs.FingerprintRespons
return c.config.Node
}

// updateNodeFromHealthCheck receives a health check response and updates the
// node accordingly
func (c *Client) updateNodeFromHealthCheck(response *cstructs.HealthCheckResponse) *structs.Node {
c.configLock.Lock()
defer c.configLock.Unlock()
Expand Down
2 changes: 1 addition & 1 deletion client/driver/docker.go
Original file line number Diff line number Diff line change
Expand Up @@ -589,7 +589,7 @@ func (d *DockerDriver) HealthCheck(req *cstructs.HealthCheckRequest, resp *cstru
// interval at which to do them.
func (d *DockerDriver) GetHealthCheckInterval(req *cstructs.HealthCheckIntervalRequest, resp *cstructs.HealthCheckIntervalResponse) error {
resp.Eligible = true
resp.Period = 3 * time.Second
resp.Period = 1 * time.Minute
return nil
}

Expand Down
2 changes: 0 additions & 2 deletions client/driver/docker_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -267,8 +267,6 @@ func TestDockerDriver_Check_DockerHealthStatus(t *testing.T) {

require := require.New(t)

// This seems fragile, so we might need to reconsider this test if it
// proves flaky
expectedAddr, err := sockaddr.GetInterfaceIP("docker0")
if err != nil {
t.Fatalf("unable to get ip for docker0: %v", err)
Expand Down
4 changes: 4 additions & 0 deletions nomad/structs/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,16 @@ type DriverInfo struct {
UpdateTime time.Time
}

// MergeHealthCheck merges information from a health check for a drier into a
// node's driver info
func (di *DriverInfo) MergeHealthCheck(other *DriverInfo) {
di.Healthy = other.Healthy
di.HealthDescription = other.HealthDescription
di.UpdateTime = other.UpdateTime
}

// MergeFingerprint merges information from fingerprinting a node for a driver
// into a node's driver info for that driver.
func (di *DriverInfo) MergeFingerprintInfo(other *DriverInfo) {
di.Detected = other.Detected
di.Attributes = other.Attributes
Expand Down

0 comments on commit e5fc8db

Please sign in to comment.