-
Notifications
You must be signed in to change notification settings - Fork 440
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
.NET Intrumentation - validate all env. vars. before start injecting env. vars. #1094
Comments
@Kielek In case of .NET, during the validation phase, environment variables are set to the copy of container object and at last actual container object is updated. pod.Spec.Containers[index] = container In case of other language instrumentation (Java, Python, NodeJS), the problem described here do exists. Please let me know, if this is ok or some other cases needs to be handled. |
@avadhut123pisal It is only a "shallow copy" and the "original" container env vars can be still modified here:
This is how I think it could be fixed:
I would prefer to do validation before manipulation as it would result in a more performant code. It can be more readable after refactoring. |
@pellared I got your point. I will update the PR accordingly. |
@avadhut123pisal, I agree with @pellared, I have one more comment, in your draft PR. |
@pellared Looking at the existing implementation, it seems that we need to validate only those env vars, whose value needs to be concatenated with the value defined in Operator code, for eg. JAVA_TOOL_OPTIONS, NODE_OPTIONS. Other env vars can have their value populated using valueFrom syntax. |
I think this behavior and the log message are misleading.
When
false
is returned then it interrupts processing next env vars.It could leave the container in a "semi-instrumented" state. Is it expected?
This comment applies also to the code BEFORE the changes introduced in this PR. Therefore, it would be better to make a separate PR to address it.
Originally posted by @pellared in #1081 (comment)
For now, .NET injecting process is validating env. variables and injecting it one by one, instead of make the whole validation upfront.
The goal is to validate first and inject env. variables only when needed.
The text was updated successfully, but these errors were encountered: