-
Notifications
You must be signed in to change notification settings - Fork 3
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
[POA-1513] Add support for different agent install paths in EC2 add #28
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.
Please fix the typo; otherwise looks OK.
cmd/internal/ec2/add.go
Outdated
reportStep(message) | ||
|
||
for _, path := range agentInstallPaths { | ||
if _, err := exec.LookPath(path); err == nil { |
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 wonder whether we should be using LookPath directly, for just "postman-insights-agent", and using whichever is first in the path? Failing that, maybe use argv[0]?
I don't think there's anything necessarily wrong with building in the set of paths that we know the install script uses today, but it does mean that the two have to be kept in sync. So that's why I'm wondering whether we could be more flexible in terms of "wherever in the path postman-insights-agent" is installed or "wherever you successfully ran the agent" -- the latter seems very reasonable to me if we can make it work?
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 have added a check for the default agent path also.
cmd/internal/ec2/add.go
Outdated
} | ||
|
||
envFile, err := os.Create(envFilePath) | ||
err = util.GenrateAndWriteTemplateFile(envFileFS, envFileTemplateName, envFileBasePath, envFileName, envFiledata) |
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.
Typo
err = util.GenrateAndWriteTemplateFile(envFileFS, envFileTemplateName, envFileBasePath, envFileName, envFiledata) | |
err = util.GenerateAndWriteTemplateFile(envFileFS, envFileTemplateName, envFileBasePath, envFileName, envFiledata) |
In this PR, we have changed the
ec2 setup
command to check for the agent install path before setting it in the postman-insight-agent systemd file.Changes done:
postman-insights-agent.service
file