-
Notifications
You must be signed in to change notification settings - Fork 28
Fix command for java auto instrumentation on windows nodes #188
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
Conversation
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.
just have a small question
|
||
var ( | ||
commandLinux = []string{"cp", "/javaagent.jar", javaInstrMountPath + "/javaagent.jar"} | ||
commandWindows = []string{"CMD", "/c", "copy", "javaagent.jar", javaInstrMountPathWindows} |
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.
Just curious is there a reason why we use CMD /c instead of Copy-Item?
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.
windows nanoserver doesn't come with powershell so the sdk container wouldn't be able to run Copy-Item directly:
Command:
Copy-Item
javaagent.jar
\otel-auto-instrumentation-java
State: Waiting
Reason: RunContainerError
Last State: Terminated
Reason: StartError
Message: failed to start containerd task "a8f40a5dc034e4a566e577b42d0e86cd8d9e96ca70817c696b6a57bd5f32d39b": hcs::System::CreateProcess a8f40a5dc034e4a566e577b42d0e86cd8d9e96ca70817c696b6a57bd5f32d39b: The system cannot find the file specified.: unknown
Exit Code: 128
...
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.
Updated the description to not say powershell, but just cmd.exe
javaInitContainerName = initContainerName + "-java" | ||
javaVolumeName = volumeName + "-java" | ||
javaInstrMountPath = "/otel-auto-instrumentation-java" | ||
javaInstrMountPathWindows = "\\otel-auto-instrumentation-java" |
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.
do we need a test case for this?
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.
Test case was added in func TestInjectJavaagentWindows
Issue #, if available: N/A
Description of changes:
The above will be injected for pods with the
kubernetes.io/os: windows
node selector. The EKS documentation requires this selector be added to pods.This will not enable support for windows. The operator still needs a windows build of the auto instrumentation image.
Tested using a dev build on a windows node and saw java app running:
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.