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

Add availibity to add default attrs #636

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

bastianb
Copy link

related to #635
Its my first golang writing session would be glad to have feedback

idea is to have --attrs "attr_1=some_value,attr_2=someother_value,....." so each service have default ServiceMeta in consul.

@bastianb bastianb force-pushed the issue_635_add_attrs_using_consul branch from 07e7416 to b2e43c7 Compare August 16, 2018 20:07
bridge/util.go Outdated
meta := config.Env
for k, v := range config.Labels {
meta = append(meta, k+"="+v)
}
metadata := make(map[string]string)
metadataFromPort := make(map[string]bool)

for _, kv := range strings.Split(default_attrs, ",") {
Copy link
Author

Choose a reason for hiding this comment

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

In my use case container attrs from env or labels should override the default "forced" attrs.
So I am not sure if the name in the doc make sense, or if container should not override them, meaning that I should move this below.
What do you think?

@@ -44,6 +44,7 @@ Guide. Typically, running Registrator looks like this:
Usage of /bin/registrator:
/bin/registrator [options] <registry URI>

-attrs="": Append attrs (ServiceMeta) for all registered services (only for consul)
Copy link
Author

Choose a reason for hiding this comment

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

looks like that:

registrator --attrs "key_1=something,key_2=something_else"

Should I add more detail in the doc?

@bastianb bastianb force-pushed the issue_635_add_attrs_using_consul branch from b2e43c7 to 6795a50 Compare August 16, 2018 20:13
@bastianb bastianb force-pushed the issue_635_add_attrs_using_consul branch from 6795a50 to bed7fa8 Compare August 17, 2018 11:09
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