Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

mohamed-el-habib
Copy link

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

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
Member

Don't we have this somewhere already?

@mohamed-el-habib
Copy link
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.

includeLabel := getopt("INCLUDE_LABEL", "")
if includeLabel != "" {
if _, ok := container.Config.Labels[includeLabel]; ok {
// include all containers that have the includeLabel
Copy link
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
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
Author

@josegonzalez did my code need documentation ?

@itajaja
Copy link

itajaja commented Aug 25, 2016

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

@mohamed-el-habib
Copy link
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
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.

None yet

4 participants