fix(controller): keep user env vars over controller defaults#2327
Open
mesutoezdil wants to merge 2 commits into
Open
fix(controller): keep user env vars over controller defaults#2327mesutoezdil wants to merge 2 commits into
mesutoezdil wants to merge 2 commits into
Conversation
Agent env was built as user env then shared env appended after it. Same name in both means the shared value wins on the pod, since k8s takes the last entry. A user setting OTEL_SERVICE_NAME or similar on their own agent got silently overwritten by the controller default. Now shared entries are only added if the user did not already set that name. Signed-off-by: mesutoezdil <mesudozdil@gmail.com>
Signed-off-by: mesutoezdil <mesudozdil@gmail.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.
Agent env was built as user env then shared env appended after it. Same name in both means the shared value wins on the pod, since k8s takes the last entry for duplicate names. A user setting OTEL_SERVICE_NAME or KAGENT_NAME on their own agent got silently overwritten by the controller default, no error or warning.
Now shared entries are only added if the user did not already set that name, so the user's own value always wins.
Added a unit test covering the collision case.