-
Notifications
You must be signed in to change notification settings - Fork 464
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
Setting JAVA_TOOL_OPTIONS via configmap is not possible (replaced,ignored) #1814
Comments
Correct, the implementation at the moment does not check env vars defined in the config map. No objections on supporting it. |
Actually in this case I am not sure what would be the behaviour. I would say the operator should make changes to the config map - the problem would be to deal with reverting those changes. Maybe it could copy the env var value from the config map if the modification is needed? |
copying and setting it directly sounds cleaner to me. no changes to the config map needed. it's expressive and visible. |
Here’s a proposed implementation and a quick question. With a little more info I would be happy to knock this out. Proposed implementation:
Should the value form the ConfigMap overwrite the value form the container or should it be appended in some way? |
The operator should copy the value from the CM and override it. |
Awesome, thank you for the clarification! I'll start knocking this out. |
Perfect, can we make it generic enough and reuse for other/all variables? We should as well document the behavior and that these env vars cannot be hardcoded in the image #1884 |
Any update on this? |
#1393, I believe is requesting the same approach. |
Let's maybe discuss solutions here in our next SIG meeting. I don't initially love the idea of us reading values from arbitrary configmaps, i think that expands the permissions the operator needs and seems a bit unsafe, I can be persuaded otherwise. |
Any update on this? |
The issue hasn't been resolved yet. This still needs a proposal that will be accepted. |
I think that a possible solution for this case will be make a merge between the configmap variable value and the operator variable value, before inject JAVA_TOOL_OPTIONS variable value in each pod with the auto-instrumentation. Somethings like that: JAVA_TOOL_OPTIONS="$JAVA_TOOL_OPTIONS -javaagent:/otel-auto-instrumentation/javaagent.jar" What are you thinking about this proposal? |
it could work, but we would need to test it |
I prepared a fix for this in #3373 - to read POD's env variables defined in ConfigMaps and Secrets. With my fix the |
when using the operator in combination with ENVVAR from ConfigMap the original value of JAVA_TOOL_OPTIONS is ignored and therefore lost. see the append yaml and comments.
The text was updated successfully, but these errors were encountered: