fix(inject): use more robust logic to convert annotation to metric label#15176
Open
sdickhoven wants to merge 5 commits intolinkerd:mainfrom
Open
fix(inject): use more robust logic to convert annotation to metric label#15176sdickhoven wants to merge 5 commits intolinkerd:mainfrom
sdickhoven wants to merge 5 commits intolinkerd:mainfrom
Conversation
Fixes linkerd#15175 Signed-off-by: Simon Dickhoven <sdickhoven@everquote.com>
Signed-off-by: Simon Dickhoven <sdickhoven@everquote.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
this pr fixes #15175 by using a more robust method for removing the annotation prefix.
if the annotation does not have a prefix, the logic will still work because then no
/character should be found which will causestrings.Index()to return-1... and since we're then adding1, the string slice becomes[0:]which is valid and returns the entire string.kudos to @MairtinHeartyEverQuote for troubleshooting this issue.