Merge pull request #9661 from dmcgowan/update-cri-container-events-multisub

Add support for multiple subscribers to CRI container events
This commit is contained in:
Akihiro Suda
2024-01-27 15:57:30 +00:00
committed by GitHub
7 changed files with 381 additions and 45 deletions

View File

@@ -395,13 +395,7 @@ func (c *criService) generateAndSendContainerEvent(ctx context.Context, containe
ContainersStatuses: containerStatuses,
}
// TODO(ruiwen-zhao): write events to a cache, storage, or increase the size of the channel
select {
case c.containerEventsChan <- event:
default:
containerEventsDroppedCount.Inc()
log.G(ctx).Debugf("containerEventsChan is full, discarding event %+v", event)
}
c.containerEventsQ.Send(event)
}
func (c *criService) getPodSandboxStatus(ctx context.Context, podSandboxID string) (*runtime.PodSandboxStatus, error) {