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

Fix panic caused by Agent check-in when Fleet Server is upgraded from 7.14.0 previous #683

Merged
merged 1 commit into from
Aug 31, 2021

Conversation

blakerouse
Copy link
Contributor

What is the problem this PR solves?

// Please do not just reference an issue. Explain WHAT the problem this PR solves here.

When running on previous version of Fleet Server the version of the Elastic Agent was not stored. With 7.15 the version was added, but that means that on check-in it needs to handle the case that the metadata is not present.

How does this PR solve the problem?

// Explain HOW you solved the problem in your code. It is possible that during PR reviews this changes and then this section should be updated.

This adds a check to ensure that the metadata is present before checking the version field. If not present then the version will be updated correctly in 7.15 as it should.

Checklist

  • I have commented my code, particularly in hard-to-understand areas
  • [ ] I have made corresponding changes to the documentation
  • [ ] I have made corresponding change to the default configuration files
  • [ ] I have added tests that prove my fix is effective or that my feature works
  • [ ] I have added an entry in CHANGELOG.next.asciidoc or CHANGELOG-developer.next.asciidoc.

Related issues

Copy link

@scunningham scunningham left a comment

Choose a reason for hiding this comment

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

Seems an ok patch, but do we know why validateUserAgent is not returning an error?

@elasticmachine
Copy link
Contributor

💚 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 preview

Expand to view the summary

Build stats

  • Start Time: 2021-08-31T20:27:11.344+0000

  • Duration: 8 min 23 sec

  • Commit: 3572da6

Test stats 🧪

Test Results
Failed 0
Passed 215
Skipped 0
Total 215

Trends 🧪

Image of Build Times

Image of Tests

Copy link
Contributor

@aleksmaus aleksmaus left a comment

Choose a reason for hiding this comment

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

Thank you!

@blakerouse blakerouse merged commit c859cf0 into elastic:master Aug 31, 2021
@blakerouse blakerouse deleted the fix-panic-in-checkin branch August 31, 2021 20:53
mergify bot pushed a commit that referenced this pull request Aug 31, 2021
(cherry picked from commit c859cf0)
mergify bot pushed a commit that referenced this pull request Aug 31, 2021
(cherry picked from commit c859cf0)
mergify bot added a commit that referenced this pull request Aug 31, 2021
(cherry picked from commit c859cf0)

Co-authored-by: Blake Rouse <[email protected]>
mergify bot added a commit that referenced this pull request Aug 31, 2021
(cherry picked from commit c859cf0)

Co-authored-by: Blake Rouse <[email protected]>
@ruflin
Copy link
Contributor

ruflin commented Sep 1, 2021

Can you please add some tests?

@aleksmaus
Copy link
Contributor

Can you please add some tests?

#688

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Upgrade from 7.14 to 7.15 results in Elastic Agent not being able to check-in
5 participants