Skip to content

Add whereLabel* functions #143

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

Merged
merged 1 commit into from
Dec 17, 2015

Conversation

md5
Copy link
Contributor

@md5 md5 commented Dec 17, 2015

This PR adds a few functions from the whereLabel* family:

  • whereLabelExists
  • whereLabelDoesNotExist
  • whereLabelValueMatches

This should help with situations like those mentioned in #82 (comment)

Right now, these functions are strictly for []*RuntimeContainer, but they could be adjusted to work in other situations if need be. I could also see adding a hasLabel function that takes *RuntimeContainer or exposing the regexp.MatchString function used by whereLabelValueMatches, but I wanted to keep this PR simple and focused.

* whereLabelExists
* whereLabelDoesNotExist
* whereLabelValueMatches
@md5
Copy link
Contributor Author

md5 commented Dec 17, 2015

An example use case (as I mentioned in #82 (comment)) would be:

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

jwilder added a commit that referenced this pull request Dec 17, 2015
@jwilder jwilder merged commit c5309f0 into nginx-proxy:master Dec 17, 2015
@jwilder
Copy link
Collaborator

jwilder commented Dec 17, 2015

Thanks @md5!

@md5 md5 deleted the where-label-functions branch December 17, 2015 17:06
@md5
Copy link
Contributor Author

md5 commented Dec 17, 2015

👍

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.

2 participants