Skip to content

Commit

Permalink
If --agent.tags or other tags are mal-formed, display the invalid val…
Browse files Browse the repository at this point in the history
…ue as part of the panic

Signed-off-by: Ed Snible <snible@us.ibm.com>
  • Loading branch information
esnible committed Sep 3, 2021
1 parent 27fe841 commit 0bc7985
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions cmd/flags/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@ func ParseJaegerTags(jaegerTags string) map[string]string {
tags := make(map[string]string)
for _, p := range tagPairs {
kv := strings.SplitN(p, "=", 2)
if len(kv) != 2 {
panic(fmt.Sprintf("invalid Jaeger tag pair %q, expected key=value", p))
}
k, v := strings.TrimSpace(kv[0]), strings.TrimSpace(kv[1])

if strings.HasPrefix(v, "${") && strings.HasSuffix(v, "}") {
Expand Down

0 comments on commit 0bc7985

Please sign in to comment.