Update after review
This commit is contained in:
parent
5c621b74e5
commit
6a810e6f1e
|
@ -202,12 +202,11 @@ func (r *AllocRunner) saveAllocRunnerState() error {
|
|||
}
|
||||
|
||||
func (r *AllocRunner) saveTaskRunnerState(tr *TaskRunner) error {
|
||||
var err error
|
||||
if err = tr.SaveState(); err != nil {
|
||||
if err := tr.SaveState(); err != nil {
|
||||
return fmt.Errorf("client: failed to save state for alloc %s task '%s': %v",
|
||||
r.alloc.ID, tr.task.Name, err)
|
||||
}
|
||||
return err
|
||||
return nil
|
||||
}
|
||||
|
||||
// DestroyState is used to cleanup after ourselves
|
||||
|
|
|
@ -833,8 +833,7 @@ func (c *Client) registerNode() error {
|
|||
WriteRequest: structs.WriteRequest{Region: c.Region()},
|
||||
}
|
||||
var resp structs.NodeUpdateResponse
|
||||
err := c.RPC("Node.Register", &req, &resp)
|
||||
if err != nil {
|
||||
if err := c.RPC("Node.Register", &req, &resp); err != nil {
|
||||
if time.Since(c.start) > registerErrGrace {
|
||||
return fmt.Errorf("client: failed to register node: %v", err)
|
||||
}
|
||||
|
@ -867,8 +866,7 @@ func (c *Client) updateNodeStatus() error {
|
|||
WriteRequest: structs.WriteRequest{Region: c.Region()},
|
||||
}
|
||||
var resp structs.NodeUpdateResponse
|
||||
err := c.RPC("Node.UpdateStatus", &req, &resp)
|
||||
if err != nil {
|
||||
if err := c.RPC("Node.UpdateStatus", &req, &resp); err != nil {
|
||||
return fmt.Errorf("client: failed to update status: %v", err)
|
||||
}
|
||||
if len(resp.EvalIDs) != 0 {
|
||||
|
|
Loading…
Reference in New Issue