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] Handle case where policy doesn't contain Fleet connection information #25707

Merged

Conversation

blakerouse
Copy link
Contributor

@blakerouse blakerouse commented May 13, 2021

What does this PR do?

Ensures that the client connection to Fleet Server is only updated if the policy has fleet.*.

Why is it important?

Fixes #25586 because of kibana issue elastic/kibana#100050

Checklist

  • My code follows the style guidelines of this project
  • 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

@blakerouse blakerouse added Agent backport-v7.13.0 Automated backport with mergify backport-v7.14.0 Automated backport with mergify labels May 13, 2021
@blakerouse blakerouse self-assigned this May 13, 2021
@botelastic botelastic bot added the needs_team Indicates that the issue/PR needs a Team:* label label May 13, 2021
@blakerouse blakerouse marked this pull request as ready for review May 13, 2021 16:42
@elasticmachine
Copy link
Collaborator

elasticmachine commented May 13, 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 #25707 updated

  • Start Time: 2021-05-13T16:43:04.618+0000

  • Duration: 93 min 43 sec

  • Commit: e6516f6

Test stats 🧪

Test Results
Failed 0
Passed 6892
Skipped 16
Total 6908

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 6892
Skipped 16
Total 6908

@ph ph added Team:Elastic-Agent Label for the Agent team and removed Agent labels May 13, 2021
@elasticmachine
Copy link
Collaborator

Pinging @elastic/agent (Team:Agent)

@botelastic botelastic bot removed the needs_team Indicates that the issue/PR needs a Team:* label label May 13, 2021
@blakerouse blakerouse merged commit e86109e into elastic:master May 14, 2021
@blakerouse blakerouse deleted the handle-policy-without-fleet-info branch May 14, 2021 00:03
mergify bot pushed a commit that referenced this pull request May 14, 2021
…tion information (#25707)

* Handle case where policy doesn't contain Fleet connection information.

* Add changelog entry.

(cherry picked from commit e86109e)
mergify bot pushed a commit that referenced this pull request May 14, 2021
…tion information (#25707)

* Handle case where policy doesn't contain Fleet connection information.

* Add changelog entry.

(cherry picked from commit e86109e)
blakerouse added a commit that referenced this pull request May 14, 2021
…tion information (#25707) (#25713)

* Handle case where policy doesn't contain Fleet connection information.

* Add changelog entry.

(cherry picked from commit e86109e)

Co-authored-by: Blake Rouse <[email protected]>
blakerouse added a commit that referenced this pull request May 14, 2021
…tion information (#25707) (#25714)

* Handle case where policy doesn't contain Fleet connection information.

* Add changelog entry.

(cherry picked from commit e86109e)

Co-authored-by: Blake Rouse <[email protected]>
return errors.New(err, "could not convert the configuration from the policy", errors.TypeConfig)
}
if _, ok := data["fleet"]; !ok {
// no fleet information in the configuration (skip checking client)
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe worth a debug log?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-v7.13.0 Automated backport with mergify 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.

Existing agents do not re-enroll in fleet correctly after 7.12-snapshot to 7.13-snapshot upgrade
4 participants