patch: adding ability to pass labels through to the services for query #2901
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.
Which problem is this PR solving?
As it stands, we can pass annotations down to the query service using
spec.query.annotationsbut any labels reflected in thespec.query.labelsfield only get passed to the deployment. This feels like it may have just been an oversight and to be honest, it's something I actually need as I'm sure some others do.For my purposes, I need to be able to filter services based on their labels and the labels need to be custom ones such as environment, service, region and more. A long story short, it's for application discovery when using Teleport. so I can ensure certain people can only see certain services.
Description of the changes
This change sets a new variable called
labels which gets the original labels values ofutil.Labels(GetNameForQueryService(jaeger), "service-query", *jaeger)` set as the default.It then checsk to see if any additional labels have been passed and merges them into the map.
How was this change tested?
With no custom label
With custom label
Checklist
jaeger:make lint testjaeger-ui:npm run lintandnpm run test