fix(provider): use Actor.Attributes["name"] instead of deprecated From

This commit is contained in:
Alexis Couvreur
2022-11-12 17:55:49 +00:00
parent cca050be08
commit b7e17dc77c
2 changed files with 7 additions and 1 deletions

View File

@@ -121,7 +121,7 @@ func (provider *DockerClassicProvider) NotifyInsanceStopped(ctx context.Context,
select {
case msg := <-msgs:
// Send the container that has died to the channel
instance <- msg.From
instance <- msg.Actor.Attributes["name"]
case err := <-errs:
if errors.Is(err, io.EOF) {
log.Debug("provider event stream closed")

View File

@@ -187,6 +187,12 @@ func ContainerStoppedEvent(name string) events.Message {
Scope: "local",
Action: "stop",
Type: "container",
Actor: events.Actor{
ID: "randomid",
Attributes: map[string]string{
"name": name,
},
},
}
}