jaeger-operator icon indicating copy to clipboard operation
jaeger-operator copied to clipboard

Jaeger Operator does not consider variables set via envFrom

Open alexrashed opened this issue 3 years ago • 3 comments

Hey there.

When using the sidecar injection of the Jaeger Operator, it checks if the following environment variables are set:

  • JAEGER_SERVICE_NAME
  • JAEGER_PROPAGATION

https://github.com/jaegertracing/jaeger-operator/blob/bf1bc275353a0daf99dbebc7a65ea755cd7afaa1/pkg/inject/sidecar.go#L309

However, it only checks if the container spec template directly contains the environment variables. We manage the environment variables in ConfigMaps which are included in the spec template using envFrom. The JAEGER_SERVICE_NAME in the included ConfigMap is not detected, and the default value is set (.), which in turn overwrites the value which would be set by the ConfigMap.

P.s.: Thanks for the awesome tools you are providing!

alexrashed avatar Dec 16 '20 09:12 alexrashed

Would you like to work on a fix for this?

jpkrohling avatar Dec 16 '20 09:12 jpkrohling

To be honest, I'm not quite sure how to implement that without messing up the structure. As far as I can tell, the k8s client is only used in the controller itself right now. In order to access the content of the Secrets and ConfigMaps referenced in the envFrom, we would need to fetch the referenced object in sidecar.go, which doesn't seem like a clean approach to me.

Unfortunately I'm not very experienced with Go yet.

alexrashed avatar Dec 16 '20 11:12 alexrashed

That's fair, thanks for considering it anyway!

jpkrohling avatar Dec 16 '20 12:12 jpkrohling

Raised PR for this Issue.

hiteshwani29 avatar Jul 25 '23 07:07 hiteshwani29