This repository has been archived by the owner on Sep 17, 2024. It is now read-only.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
feat: add first scenario for Fleet Server #900
feat: add first scenario for Fleet Server #900
Changes from 11 commits
b1931c0
6f54550
ad0d17f
e52c8b6
e8bee02
bb62c4f
d8e57ce
6189bff
d9da8b0
830eb12
eaa68f2
bc9e1ff
4ae1019
721aa21
f5a9f46
eb8f013
e9edde9
356750f
f2244ad
7358928
bcd69ee
173004f
cb57360
6865e98
6d60a6d
04c7fc8
e5ed65c
09e4325
491eb17
a557f88
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
@EricDavisX @blakerouse I wrote this
Then
clause, but I'd like to know if there is another assertion that should be done here. Something like:the elastic-agent process is started
, orthe Fleet app in Kibana shows "FooBar" in the Fleet page
, orelasticsearch contains THIS doc in THAT index
. Preferredly queried by an API call.Could you help me here in writing the right expected behaviour?
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 am not too familiar with the structure of these files so I might not be fully understanding the context.
I believe your asking if its possible to known if the Fleet Server is running correct. The simplest way is to check that the Agent is reported Healthy in Kibana. That might seem to simple but the only way for the Agent running a Fleet Server to show in Kibana as healthy is if it can communicate to its local Fleet Server and that Fleet Server can write to elasticsearch.
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.
Never mind about the code structure yet, I'm still interested in the behavior of the product without considering internal details/implementations.
With that in mind:
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.
The check can be the same as for all Agents, that it is listed as 'healthy' in the Agents API list call. A secondary check could be to assess if the Fleet Server process is running on the host, as noted in this example:
This example is from macOS, but the the process name is the same.
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.
Didn't actually tried, but I think it would be a bit simpler to have just 1 kind of config and 1 way of creating it, eg:
func NewAgentConfig(token, fleetServerMode bool) (*AgentConfig, error)
Credentials, url and port can also be hardcoded in the only place they are used.
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.
Sure, let me send a follow-up commit with that, thanks!
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.
Implemented in f5a9f46
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.
Remove some leftovers: the type is automatically inferred by the Go compiler