Merge pull request #22985 from samuelkarp/awslogs-logging-driver
awslogs: Fix a race in mockcwlogsclient
This commit is contained in:
commit
dca92044be
1 changed files with 8 additions and 1 deletions
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue