logspout icon indicating copy to clipboard operation
logspout copied to clipboard

Support swarm service labels when using filter.labels

Open erbrecht opened this issue 5 years ago • 1 comments

If a container was started by a swarm service, this additionally checks the service labels in the MatchContainer function. It also looks at service labels when deciding whether to ignore a container based on labels. This approach doesn't require any special configuration, it should just work seamlessly whether containers are started individually or as part of a service or stack.

erbrecht avatar Aug 17 '19 01:08 erbrecht

After submitting this, I realized that the IgnoreContainer function in pump.go should probably accept a *docker.Container and *swarm.Service instead of *docker.Container and map[string]string of labels. I think it makes more sense for them to be similar types. I made these changes in my repo and they pass the tests but I haven't pushed them yet. I wanted to see if there was any feedback on this first.

erbrecht avatar Aug 18 '19 14:08 erbrecht