Skip to content

added the ability to include only container having label using INCLUDE_LABEL param#222

Open
mohamed-el-habib wants to merge 3 commits into
gliderlabs:masterfrom
mohamed-el-habib:master
Open

added the ability to include only container having label using INCLUDE_LABEL param#222
mohamed-el-habib wants to merge 3 commits into
gliderlabs:masterfrom
mohamed-el-habib:master

Conversation

@mohamed-el-habib

@mohamed-el-habib mohamed-el-habib commented Aug 10, 2016

Copy link
Copy Markdown

Added the ability to include only container having label using INCLUDE_LABEL param (Same as EXCLUDE_LABEL). I'm using this feature to use logspout container into docker-compose.yml. add expose log of others services throw http

@josegonzalez

Copy link
Copy Markdown
Member

Don't we have this somewhere already?

@mohamed-el-habib

Copy link
Copy Markdown
Author

Maybe i missed that, but as i saw there are some things similar when logs are routed, but no things when logs are pumped.

Comment thread router/pump.go Outdated
includeLabel := getopt("INCLUDE_LABEL", "")
if includeLabel != "" {
if _, ok := container.Config.Labels[includeLabel]; ok {
// include all containers that have the includeLabel

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comments shouldn't be necessary, and if they are, the code needs to be made more clear.

@mohamed-el-habib

Copy link
Copy Markdown
Author

@josegonzalez : I simplified the code as i can (i my first time with golang), and updated the README.md.

@mohamed-el-habib

Copy link
Copy Markdown
Author

@josegonzalez did my code need documentation ?

@itajaja

itajaja commented Aug 25, 2016

Copy link
Copy Markdown

what's the difference between this vs the filter approach?

@mohamed-el-habib

Copy link
Copy Markdown
Author

May be, misunderstood the filter approach. My use case is to have a docker-compose file with a list of containers for my application. And I want to add logspout container to this compose file. I want logspout to load only the compose container 's logs and expose them throw http module. How can I do that using filter approach.

@michaelshobbs

Copy link
Copy Markdown
Member

@MattAitchison @josegonzalez Thoughts on having both INCLUDE & EXCLUDE?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants