Merge pull request #22985 from samuelkarp/awslogs-logging-driver

awslogs: Fix a race in mockcwlogsclient
This commit is contained in:
Michael Crosby 2016-05-25 13:08:00 -07:00
commit dca92044be

View file

@ -44,7 +44,14 @@ func (m *mockcwlogsclient) CreateLogStream(input *cloudwatchlogs.CreateLogStream
}
func (m *mockcwlogsclient) PutLogEvents(input *cloudwatchlogs.PutLogEventsInput) (*cloudwatchlogs.PutLogEventsOutput, error) {
m.putLogEventsArgument <- input
events := make([]*cloudwatchlogs.InputLogEvent, len(input.LogEvents))
copy(events, input.LogEvents)
m.putLogEventsArgument <- &cloudwatchlogs.PutLogEventsInput{
LogEvents: events,
SequenceToken: input.SequenceToken,
LogGroupName: input.LogGroupName,
LogStreamName: input.LogStreamName,
}
output := <-m.putLogEventsResult
return output.successResult, output.errorResult
}