-
Notifications
You must be signed in to change notification settings - Fork 209
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
feat: webhook to set agent injection env var with odigos additions #2107
base: main
Are you sure you want to change the base?
feat: webhook to set agent injection env var with odigos additions #2107
Conversation
@@ -52,6 +53,15 @@ type InstrumentationConfigStatus struct { | |||
RuntimeDetailsByContainer []RuntimeDetailsByContainer `json:"runtimeDetailsByContainer,omitempty"` | |||
} | |||
|
|||
func (in *InstrumentationConfigStatus) GetRuntimeDetailsForContainer(container v1.Container) *RuntimeDetailsByContainer { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We usually host these sort of functions in k8sutils
. WDYT?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As we discussed let's discuss on this with @RonFed and take decision here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm OK with both options as long we don't have duplicated functions in more than one place.
It feels like we have a lot of functions like this in
func getLanguageOfContainer(runtimeDetails []odigosv1.RuntimeDetailsByContainer, containerName string) common.ProgrammingLanguage { |
func getContainerOtherAgents(runtimeDetails []odigosv1.RuntimeDetailsByContainer, containerName string) *odigosv1.OtherAgent { |
func getLibCTypeOfContainer(runtimeDetails []odigosv1.RuntimeDetailsByContainer, containerName string) *common.LibCType { |
instrumentor/internal/webhook_env_injector/webhook_env_injector.go
Outdated
Show resolved
Hide resolved
instrumentor/internal/webhook_env_injector/webhook_env_injector.go
Outdated
Show resolved
Hide resolved
instrumentor/internal/webhook_env_injector/webhook_env_injector.go
Outdated
Show resolved
Hide resolved
instrumentor/internal/webhook_env_injector/webhook_env_injector.go
Outdated
Show resolved
Hide resolved
instrumentor/internal/webhook_env_injector/webhook_env_injector.go
Outdated
Show resolved
Hide resolved
instrumentor/internal/webhook_env_injector/webhook_env_injector.go
Outdated
Show resolved
Hide resolved
instrumentor/internal/webhook_env_injector/webhook_env_injector.go
Outdated
Show resolved
Hide resolved
67512da
to
d5924cc
Compare
@@ -52,6 +53,15 @@ type InstrumentationConfigStatus struct { | |||
RuntimeDetailsByContainer []RuntimeDetailsByContainer `json:"runtimeDetailsByContainer,omitempty"` | |||
} | |||
|
|||
func (in *InstrumentationConfigStatus) GetRuntimeDetailsForContainer(container v1.Container) *RuntimeDetailsByContainer { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm OK with both options as long we don't have duplicated functions in more than one place.
It feels like we have a lot of functions like this in
func getLanguageOfContainer(runtimeDetails []odigosv1.RuntimeDetailsByContainer, containerName string) common.ProgrammingLanguage { |
func getContainerOtherAgents(runtimeDetails []odigosv1.RuntimeDetailsByContainer, containerName string) *odigosv1.OtherAgent { |
func getLibCTypeOfContainer(runtimeDetails []odigosv1.RuntimeDetailsByContainer, containerName string) *common.LibCType { |
instrumentor/internal/webhook_env_injector/webhook_env_injector.go
Outdated
Show resolved
Hide resolved
Would you please update the test cases re:reported-name like I did in 8b60b1d ? You can probably just cherry pick that commit |
594b83a
to
b01a9dc
Compare
|
The original test used the same resource names for 2 runs of traffic generation. So the first time it would generate 13 spans and then 13 more. But now the test updates the reported-name after the first set is generated, so the new set of spans is just 13 entirely new resources. |
5770291
to
f67f0ba
Compare
Done, the requested commit has been cherry-picked. |
This is the initial phase of enabling the webhook to set agent injection-related environment variables (e.g., PYTHONPATH). The plan is to merge this after the migration and the new runtime inspection have been running for a while.
Once enough time has passed, I will merge this change to handle simpler cases where the envOverwriter is not involved. After this phase runs for a sufficient period, we can fully remove the envOverwriter and rely solely on this logic.
Finally, we can clean up the remaining code related to the envOverwriter.