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

Expose RuntimeContainer.Labels #82

Merged
merged 1 commit into from
May 4, 2015

Conversation

md5
Copy link
Contributor

@md5 md5 commented May 2, 2015

Related: #81

@jwilder
Copy link
Collaborator

jwilder commented May 2, 2015

@md5 nice! Been meaning to add this but haven't had time. Need to test it out but looks pretty straightforward.

@md5
Copy link
Contributor Author

md5 commented May 2, 2015

👍

@thaJeztah
Copy link
Contributor

Great!

/me should suggest to add @md5 as maintainer to this and the nginx-proxy repos

jwilder added a commit that referenced this pull request May 4, 2015
@jwilder jwilder merged commit 243cb0d into nginx-proxy:master May 4, 2015
@md5 md5 deleted the add-label-support branch May 4, 2015 16:38
@tompson
Copy link

tompson commented Nov 9, 2015

Is there a sample somewhere on how to use labels in a template? I somehow can not get it to work

@tompson
Copy link

tompson commented Nov 10, 2015

The problem is that the labels generated by compose are looking like

 com.docker.compose.service

How do you access them in the template?

@md5
Copy link
Contributor Author

md5 commented Nov 10, 2015

I believe index .Labels "com.docker.compose.service" should work. (Update: corrected from .Env.Labels to .Labels)

@trnubo
Copy link

trnubo commented Nov 20, 2015

Sorry if this is the wrong place to ask. How would you use a label such as "com.docker.compose.service" in as part of a $fieldPath with a groupBy or where?

where . "Labels.com.docker.compose.service" "web"

@md5
Copy link
Contributor Author

md5 commented Nov 20, 2015

@trnubo I don't think it's going to be possible to do that right now. I also think it would be tricky to get right.

Adding groupByLabel and whereLabel functions might not be the worst idea, although it would balloon pretty quickly if you add *Label variants of all the existing where* and groupBy* functions.

@md5 md5 mentioned this pull request Dec 17, 2015
@md5
Copy link
Contributor Author

md5 commented Dec 17, 2015

@trnubo Take a look at #143

@md5
Copy link
Contributor Author

md5 commented Dec 17, 2015

For the case you mentioned, you could do this:

whereLabelValueMatches . "com.docker.compose.service" "^web$"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants