Skip to content
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

[elastic-agent] Add hint to version command for binary #25380

Merged
merged 3 commits into from
Apr 28, 2021

Conversation

ruflin
Copy link
Collaborator

@ruflin ruflin commented Apr 28, 2021

By default when running elastic-agent version it is expected that the daemon is running. If it is not running, an error is shown. Then the flag --binary-only should be used. A hint for this is added here to the error message for users.

By default when running `elastic-agent version` it is expected that the daemon is running. If it is not running, an error is shown. Then the flag --binary-only should be used. A hint for this is added here to the error message for users.
@ruflin ruflin added Team:Elastic-Agent Label for the Agent team backport-v7.14.0 Automated backport with mergify labels Apr 28, 2021
@elasticmachine
Copy link
Collaborator

Pinging @elastic/agent (Team:Agent)

@botelastic botelastic bot added needs_team Indicates that the issue/PR needs a Team:* label and removed needs_team Indicates that the issue/PR needs a Team:* label labels Apr 28, 2021
@@ -64,7 +64,7 @@ func NewCommandWithArgs(streams *cli.IOStreams) *cobra.Command {
binaryOnly, _ := cmd.Flags().GetBool("binary-only")
if !binaryOnly {
if d, err := queryDaemon(); err != nil {
returnErr = fmt.Errorf("failed to communicate with running daemon: %w", err)
returnErr = fmt.Errorf("could not get version. failed to communicate with running daemon: %w\n Use --binary-only flag to get version from binary.", err)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would update that to so

Use --binary-only flag to skip trying to retrieve version from running daemon.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated

Copy link
Contributor

@blakerouse blakerouse left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a comment on the wording. Overall looks good.

@elasticmachine
Copy link
Collaborator

elasticmachine commented Apr 28, 2021

💚 Build Succeeded

the below badges are clickable and redirect to their specific view in the CI or DOCS
Pipeline View Test View Changes Artifacts preview

Expand to view the summary

Build stats

  • Build Cause: Pull request #25380 updated

  • Start Time: 2021-04-28T14:59:33.928+0000

  • Duration: 103 min 32 sec

  • Commit: f6f4936

Test stats 🧪

Test Results
Failed 0
Passed 6788
Skipped 16
Total 6804

Trends 🧪

Image of Build Times

Image of Tests

💚 Flaky test report

Tests succeeded.

Expand to view the summary

Test stats 🧪

Test Results
Failed 0
Passed 6788
Skipped 16
Total 6804

@ruflin ruflin merged commit 7916ad4 into elastic:master Apr 28, 2021
@ruflin ruflin deleted the improve-version-error-message branch April 28, 2021 17:09
mergify bot pushed a commit that referenced this pull request Apr 28, 2021
By default when running `elastic-agent version` it is expected that the daemon is running. If it is not running, an error is shown. Then the flag --binary-only should be used. A hint for this is added here to the error message for users.

(cherry picked from commit 7916ad4)
ruflin added a commit that referenced this pull request Apr 28, 2021
By default when running `elastic-agent version` it is expected that the daemon is running. If it is not running, an error is shown. Then the flag --binary-only should be used. A hint for this is added here to the error message for users.

(cherry picked from commit 7916ad4)

Co-authored-by: Nicolas Ruflin <spam@ruflin.com>
@dikshachauhan-qasource
Copy link

Hi @ph and @jlind23

We have validated this feature in lieu of github.com//issues/20825 ticket on 8.0 BC1 and 8.0 snapshot build and found it working fine there.

Screenshots:
image
image

Further, we will validate same on 8.1 too once stable build BC2 will be available.

Thanks
QAS

@dikshachauhan-qasource
Copy link

Hi @jlind23

We have revalidated it on 8.1 snapshot build and found it working fine there too.

Screenshot:
image

Thanks
QAS

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-v7.14.0 Automated backport with mergify Team:Elastic-Agent Label for the Agent team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants