Skip to content

Commit

Permalink
Start the container image forwarder
Browse files Browse the repository at this point in the history
  • Loading branch information
L3n41c committed Dec 23, 2022
1 parent 201e7ed commit a3a6259
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions pkg/aggregator/demultiplexer_agent.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ type forwarders struct {
orchestrator forwarder.Forwarder
eventPlatform epforwarder.EventPlatformForwarder
containerLifecycle *forwarder.DefaultForwarder
containerImage *forwarder.DefaultForwarder
}

type dataOutputs struct {
Expand Down Expand Up @@ -239,6 +240,7 @@ func initAgentDemultiplexer(options AgentDemultiplexerOptions, hostname string)
orchestrator: orchestratorForwarder,
eventPlatform: eventPlatformForwarder,
containerLifecycle: containerLifecycleForwarder,
containerImage: containerImageForwarder,
},

sharedSerializer: sharedSerializer,
Expand Down Expand Up @@ -318,6 +320,15 @@ func (d *AgentDemultiplexer) Run() {
log.Debug("not starting the container lifecycle forwarder")
}

// container image forwarder
if d.forwarders.containerImage != nil {
if err := d.forwarders.containerImage.Start(); err != nil {
log.Errorf("error starting container image forwarder: %v", err)
}
} else {
log.Debug("no starting the container image forwarder")
}

// shared forwarder
if d.forwarders.shared != nil {
d.forwarders.shared.Start() //nolint:errcheck
Expand Down Expand Up @@ -430,6 +441,10 @@ func (d *AgentDemultiplexer) Stop(flush bool) {
d.dataOutputs.forwarders.containerLifecycle.Stop()
d.dataOutputs.forwarders.containerLifecycle = nil
}
if d.dataOutputs.forwarders.containerImage != nil {
d.dataOutputs.forwarders.containerImage.Stop()
d.dataOutputs.forwarders.containerImage = nil
}
if d.dataOutputs.forwarders.shared != nil {
d.dataOutputs.forwarders.shared.Stop()
d.dataOutputs.forwarders.shared = nil
Expand Down

0 comments on commit a3a6259

Please sign in to comment.