Skip to content

[Ingest Manager] add upgrade action#77412

Merged
neptunian merged 17 commits intoelastic:masterfrom
neptunian:73069-upgrade-action
Sep 23, 2020
Merged

[Ingest Manager] add upgrade action#77412
neptunian merged 17 commits intoelastic:masterfrom
neptunian:73069-upgrade-action

Conversation

@neptunian
Copy link
Copy Markdown
Contributor

@neptunian neptunian commented Sep 14, 2020

This is the server side work for supporting agent UPGRADE action. #73069

  • add agents/{agent-id}/upgrade api which triggers UPGRADE action and accepts a "source_uri" and "version".
  • for now, only versions matching the kibana version are accepted
  • fixes a bug where getting data from new agent actions was not being decrypted

Test

  • integration tests should pass
  • To manually test, POST to the api:
curl -X POST -H 'kbn-xsrf: true'  -u elastic:changeme http://localhost:5601/api/ingest_manager/fleet/agents/AGENT_ID/upgrade \
-H 'Content-Type: application/json' \
-d '{"source_uri":"http://localhost:8000","version":"8.0.0"}'

and make sure a new fleet-agent-actions saved object is created of type UPGRADE

@neptunian neptunian self-assigned this Sep 14, 2020
@neptunian neptunian added Team:Fleet Team label for Observability Data Collection Fleet team release_note:enhancement v7.10.0 v8.0.0 labels Sep 14, 2020
@michalpristas
Copy link
Copy Markdown
Contributor

i will need to test a bit more mainly ACK but as it is now it works with my version of agent

@neptunian neptunian force-pushed the 73069-upgrade-action branch 2 times, most recently from 7341e49 to 654f7cd Compare September 18, 2020 17:49
@neptunian neptunian marked this pull request as ready for review September 22, 2020 14:32
@neptunian neptunian requested a review from a team September 22, 2020 14:32
@elasticmachine
Copy link
Copy Markdown
Contributor

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

Copy link
Copy Markdown
Member

@nchaulet nchaulet left a comment

Choose a reason for hiding this comment

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

it works as expected 🚀

@neptunian
Copy link
Copy Markdown
Contributor Author

@elasticmachine merge upstream

@kibanamachine
Copy link
Copy Markdown
Contributor

💚 Build Succeeded

Build metrics

page load bundle size

id value diff baseline
ingestManager 518.8KB +137.0B 518.7KB

distributable file count

id value diff baseline
default 45895 +2 45893

Saved Objects .kibana field count

id value diff baseline
fleet-agents 25 +2 23

History

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

@neptunian neptunian merged commit a00b3ee into elastic:master Sep 23, 2020
neptunian added a commit to neptunian/kibana that referenced this pull request Sep 23, 2020
* at agents/agent-id/upgrade endpoint

* handle upgrade ack

* let upgrade endpoint accept url and version

* wrap action data in data prop

* decrypt data of actions

* type upgrade action and decrypt data in ack

* error if trying to update to diff version of kibana

* add some integration tests

* untype

* fix test

* update integration test

* reset upgraded_at when upgrading

* use defaultIngestErrorHandler

* use ack_data instead of data

* copy data to ack_data
# Conflicts:
#	x-pack/plugins/ingest_manager/common/types/rest_spec/agent.ts
#	x-pack/plugins/ingest_manager/server/routes/agent/index.ts
#	x-pack/plugins/ingest_manager/server/types/rest_spec/agent.ts
#	x-pack/test/ingest_manager_api_integration/apis/fleet/index.js
neptunian added a commit to neptunian/kibana that referenced this pull request Sep 24, 2020
* at agents/agent-id/upgrade endpoint

* handle upgrade ack

* let upgrade endpoint accept url and version

* wrap action data in data prop

* decrypt data of actions

* type upgrade action and decrypt data in ack

* error if trying to update to diff version of kibana

* add some integration tests

* untype

* fix test

* update integration test

* reset upgraded_at when upgrading

* use defaultIngestErrorHandler

* use ack_data instead of data

* copy data to ack_data
neptunian added a commit that referenced this pull request Sep 24, 2020
* at agents/agent-id/upgrade endpoint

* handle upgrade ack

* let upgrade endpoint accept url and version

* wrap action data in data prop

* decrypt data of actions

* type upgrade action and decrypt data in ack

* error if trying to update to diff version of kibana

* add some integration tests

* untype

* fix test

* update integration test

* reset upgraded_at when upgrading

* use defaultIngestErrorHandler

* use ack_data instead of data

* copy data to ack_data
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release_note:enhancement Team:Fleet Team label for Observability Data Collection Fleet team v7.10.0 v8.0.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants