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] Adjust to Fleet Server connection information from Kibana in configuration #24713

Merged
merged 7 commits into from
Apr 8, 2021

Conversation

blakerouse
Copy link
Contributor

@blakerouse blakerouse commented Mar 23, 2021

What does this PR do?

This adjusts the Elastic Agent to look for connection information to Fleet Server at fleet.hosts instead of fleet.kibana.hosts.

NOTE: This is a breaking change and needs to land at the same time as elastic/kibana#94364

NOTE: This also requires that Endpoint Security adjust how it reads the Fleet configuration from the configuration that Elastic Agent sends it.

Why is it important?

With the transition to Fleet Server from Kibana, Elastic Agent no longer talks directly to Kibana and needs connection information to Fleet Server instead of Kibana.

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.

@blakerouse blakerouse added the Team:Elastic-Agent Label for the Agent team label Mar 23, 2021
@blakerouse blakerouse self-assigned this Mar 23, 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 Mar 23, 2021
@elasticmachine
Copy link
Collaborator

elasticmachine commented Mar 23, 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 #24713 updated

  • Start Time: 2021-04-08T12:51:37.145+0000

  • Duration: 52 min 21 sec

  • Commit: 1a06dc2

Test stats 🧪

Test Results
Failed 0
Passed 6612
Skipped 16
Total 6628

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 6612
Skipped 16
Total 6628

@blakerouse
Copy link
Contributor Author

This is now ready to land. The change has already landed in Kibana and Endpoint Security.

Copy link
Contributor

@michalpristas michalpristas left a comment

Choose a reason for hiding this comment

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

this seems rather mechanical code change. looks good i will test it locally before approving

}
}

return nil
return newAST.root.(*Dict), nil
Copy link
Contributor

Choose a reason for hiding this comment

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

this can panic

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I added a guard to prevent possible panic

}
values[idx] = newAST.root
}
}
return nil
return l, nil
Copy link
Contributor

Choose a reason for hiding this comment

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

returning same what we passed in?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is so mapList and mapDict have the same behavior of returning possible a new node. In the case of mapList it will not return a new node, but in mapDict it does.

@blakerouse blakerouse added the backport-v7.13.0 Automated backport with mergify label Apr 8, 2021
Copy link
Contributor

@michalpristas michalpristas left a comment

Choose a reason for hiding this comment

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

👍

@blakerouse blakerouse merged commit 974f255 into elastic:master Apr 8, 2021
@blakerouse blakerouse deleted the agent-fleet-url branch April 8, 2021 15:27
mergify bot pushed a commit that referenced this pull request Apr 8, 2021
…bana in configuration (#24713)

* Adjust fleet.kibana.* to just fleet.*

* Switch from fleet.kibana.* to fleet.* for connection.

* Add changelog entry.

* Add check to ensure no possible panic in mapDict.

(cherry picked from commit 974f255)
blakerouse added a commit that referenced this pull request Apr 8, 2021
…bana in configuration (#24713) (#24992)

* Adjust fleet.kibana.* to just fleet.*

* Switch from fleet.kibana.* to fleet.* for connection.

* Add changelog entry.

* Add check to ensure no possible panic in mapDict.

(cherry picked from commit 974f255)

Co-authored-by: Blake Rouse <blake.rouse@elastic.co>
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 Team:Elastic-Agent Label for the Agent team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants