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] add upgrade action #77412

Merged
merged 17 commits into from
Sep 23, 2020

Conversation

neptunian
Copy link
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

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

@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
Contributor

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

Copy link
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
Contributor Author

@elasticmachine merge upstream

@kibanamachine
Copy link
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.

5 participants