Skip to content

Commit

Permalink
code review fixups
Browse files Browse the repository at this point in the history
  • Loading branch information
sparrc committed Sep 12, 2019
1 parent b8fc11e commit 0dc4b86
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions agent/app/agent.go
Original file line number Diff line number Diff line change
Expand Up @@ -626,13 +626,13 @@ func (agent *ecsAgent) startSpotInstanceDrainingPoller(client api.ECSClient) {
}
}

// spotInstanceDrainingPoller returns true if spot instance termination time has been
// spotInstanceDrainingPoller returns true if spot instance interruption has been
// set AND the container instance state is successfully updated to DRAINING.
func (agent *ecsAgent) spotInstanceDrainingPoller(client api.ECSClient) bool {
// this endpoint 404s unless a termination time has been set, so expect failure in most cases.
// this endpoint 404s unless a interruption has been set, so expect failure in most cases.
termtime, err := agent.ec2MetadataClient.SpotInstanceAction()
if err == nil && len(termtime) > 0 {
seelog.Infof("Received a spot termination time (%s), setting state to DRAINING", termtime)
seelog.Infof("Received a spot interruption (%s), setting state to DRAINING", termtime)
err = client.UpdateContainerInstancesState(agent.containerInstanceARN, "DRAINING")
if err != nil {
seelog.Errorf("Error setting instance [ARN: %s] state to DRAINING: %s", agent.containerInstanceARN, err)
Expand Down

0 comments on commit 0dc4b86

Please sign in to comment.