-
Notifications
You must be signed in to change notification settings - Fork 11
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
Retrieve agent id command #154
Conversation
ceb5efc
to
ee8e6fb
Compare
a06eb54
to
1aa075a
Compare
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 a tiny comment then we can merge
1aa075a
to
c52ff4b
Compare
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
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 would remove the added documentation.
Besides that, good to go
c52ff4b
to
374cfde
Compare
RunE: func(cmd *cobra.Command, args []string) error { | ||
agentID, err := agent.GetAgentID() | ||
if err != nil { | ||
return err |
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.
For completeness: as per suggestion I changed from previous proposal that has log.Fatal("Failed to get Agent id: ", err)
.
This changes the output in error scenario from:
FATA[0000] Failed to get Agent id: open /etc/machine-idz: no such file or directory
to
Error: open /etc/machine-idz: no such file or directory
Usage: ...
Flags: ...
Global Flags: ...
Error: open /etc/machine-idz: no such file or directory
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.
@CDimonaco are we good with the changes? Anything else is needed prior merging?
374cfde
to
378ad54
Compare
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.
Thanks @nelsonkopliku ,
Perfect now from my side
This PR adds a command to reliably retrieve the agent id from a trento-agent installation.
Here's the usage
And here's a sample output in case of an error