-
Notifications
You must be signed in to change notification settings - Fork 196
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: Collect Language Version in Runtime #1434
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.
LGTM
left few minor comments
procdiscovery/pkg/process/process.go
Outdated
const JavaVersionConst = "JAVA_VERSION" | ||
|
||
// envDetailsSeparatorMap is a map of environment variables and their separators | ||
var envDetailsSeparatorMap = []string{NodeVersionConst, PythonVersionConst, JavaVersionConst} |
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.
🤔 this is a slice not a map
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.
haha, yeah it was a map and I changed it to a slice, forgot to change the name
procdiscovery/pkg/process/process.go
Outdated
} | ||
|
||
for _, env := range envDetailsSeparatorMap { |
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.
Consider converting envDetailsSeparatorMap
from slice to map[strings]struct{}
This way you can look directly the keys instead of iterating the map every time
envs = make([]odigosv1.EnvVar, 0, len(inspectProc.Environments.OverwriteEnvs)) | ||
for envName, envValue := range inspectProc.Environments.OverwriteEnvs { | ||
|
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.
This will panic if getRelevantEnvVars
returns nil
I don't think this is a good fix for the nil issue. |
cf407a1
to
0e8f27f
Compare
@@ -10,12 +10,34 @@ import ( | |||
"github.com/odigos-io/odigos/common/envOverwrite" | |||
) | |||
|
|||
const NodeVersionConst = "NODE_VERSION" | |||
const PythonVersionConst = "PYTHON_VERSION" | |||
const JavaVersionConst = "JAVA_VERSION" |
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 think these should be defined per language and not here
const PythonVersionConst = "PYTHON_VERSION" | ||
const JavaVersionConst = "JAVA_VERSION" | ||
|
||
// envDetailsMap is a map of environment variables and their separators |
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.
// envDetailsMap is a map of environment variables and their separators | |
// envDetailsMap is a map of environment variables used to discover additional details on the runtime |
No description provided.