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

[Ingest Manager] Validate agent version <= Kibana version #70339

Merged
merged 1 commit into from
Jun 30, 2020

Conversation

nchaulet
Copy link
Member

Summary

Resolve #69922

When using Fleet: validate that Elastic agent version <= Kibana version otherwise throw a 400 error

How to test this?

You can try to manually enroll an agent with

curl --request POST \
  --url http://localhost:5601/api/ingest_manager/fleet/agents/enroll \
  --header 'authorization: ApiKey ${REPLACE_BY_YOUR_KEY}' \
  --header 'content-type: application/json' \
  --header 'kbn-xsrf: as' \
  --data '{
 "type": "PERMANENT",
	"metadata": { "local" : {"elastic": {"agent": {"version": "99.0.0"} }}, "user_provided": {}}
}'

@nchaulet nchaulet added v8.0.0 release_note:skip Skip the PR/issue when compiling release notes v7.9.0 Team:Fleet Team label for Observability Data Collection Fleet team Ingest Management:beta1 labels Jun 30, 2020
@nchaulet nchaulet requested a review from a team June 30, 2020 15:57
@nchaulet nchaulet self-assigned this Jun 30, 2020
@elasticmachine
Copy link
Contributor

Pinging @elastic/ingest-management (Team:Ingest Management)

@kibanamachine
Copy link
Contributor

💚 Build Succeeded

Build metrics

✅ unchanged

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

@nchaulet nchaulet merged commit 4784686 into elastic:master Jun 30, 2020
nchaulet added a commit to nchaulet/kibana that referenced this pull request Jun 30, 2020
@nchaulet nchaulet deleted the feature-validate-agent-version branch June 30, 2020 18:42
Bamieh pushed a commit to Bamieh/kibana that referenced this pull request Jul 1, 2020
@EricDavisX
Copy link
Contributor

the latest 8.0 snapshot is failing when I try to enroll an Agent. Did we not update the UI 'enroll command' to be in line with this api change? we can track it in this issue: #70726

@@ -18,6 +20,12 @@ export async function enroll(
metadata?: { local: any; userProvided: any },
sharedId?: string
): Promise<Agent> {
const kibanaVersion = appContextService.getKibanaVersion();
const version: string | undefined = metadata?.local?.elastic?.agent?.version;
if (!version || semver.compare(version, kibanaVersion) === 1) {
Copy link
Contributor

Choose a reason for hiding this comment

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

I think .lte or another comparison function is easier to understand. I had to look up the compare and it results to understand what was happening.

Do we need to set the includePrerelease option https://github.com/npm/node-semver#functions to deal with values like 8.0.0-SNAPSHOT?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release_note:skip Skip the PR/issue when compiling release notes Team:Fleet Team label for Observability Data Collection Fleet team v7.9.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Ingest Manager] Agent 8.0 can connect to 7.8 Kibana
6 participants