Skip to content

Conversation

@jen-huang
Copy link
Contributor

Summary

Follow up to #78221. In that PR, saved object migrations was added for agent policy change actions to support the renamed fields, but data field is encrypted so the migration did not work fully.

This PR fixes that by using EncryptedSavedObject plugin's createMigration() so that the encrypted data field can properly be read, parsed, and restructured.

I tested this by comparing the response of the agent checkin endpoint (which returns decrypted unacknowledged actions) between 7.9 branch and this PR branch. I seeded the data using 7.9 and the migrations kicked in properly after switching versions:

POST /api/ingest_manager/fleet/agents/2fddde39-5591-49d3-a8c9-0b80eeaf4a4d/checkin
{
    "action": "checkin",
    "actions": [
        {
            "agent_id": "2fddde39-5591-49d3-a8c9-0b80eeaf4a4d",
+            "type": "POLICY_CHANGE",
-            "type": "CONFIG_CHANGE",
            "data": {
+                "policy": {
-                "config": {
                    "id": "c8718610-0367-11eb-a0f4-85d0971da8ba",
                    "outputs": {
...

@jen-huang jen-huang added bug Fixes for quality problems that affect the customer experience v8.0.0 release_note:skip Skip the PR/issue when compiling release notes v7.10.0 Team:Fleet Team label for Observability Data Collection Fleet team labels Sep 30, 2020
@jen-huang jen-huang requested review from a team and nchaulet September 30, 2020 23:43
@jen-huang jen-huang self-assigned this Sep 30, 2020
@elasticmachine
Copy link
Contributor

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

@jen-huang jen-huang changed the title [Fleet] /fix/action migration [Fleet] Fix agent policy change action migration Sep 30, 2020
@kibanamachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

✅ unchanged

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

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.

🚀

@jen-huang jen-huang merged commit b3c37cf into elastic:master Oct 1, 2020
@jen-huang jen-huang deleted the ingest/fix/action-migration branch October 1, 2020 18:10
jen-huang added a commit to jen-huang/kibana that referenced this pull request Oct 1, 2020
* Fix agent policy change action migration for encrypted `data` property

* Parse & re-stringify `config`->`policy` data
jen-huang added a commit to jen-huang/kibana that referenced this pull request Oct 1, 2020
jen-huang added a commit that referenced this pull request Oct 1, 2020
* Fix agent policy change action migration for encrypted `data` property

* Parse & re-stringify `config`->`policy` data
phillipb added a commit to phillipb/kibana that referenced this pull request Oct 1, 2020
…aly-detection-partition-field

* 'master' of github.com:elastic/kibana: (76 commits)
  Fix z-index of KQL Suggestions dropdown (elastic#79184)
  [babel] remove unused/unneeded babel plugins (elastic#79173)
  [Search] Fix timeout upgrade link (elastic#79045)
  Always Show Embeddable Panel Header in Edit Mode (elastic#79152)
  [Ingest]: add more test for transform index (elastic#79154)
  [ML] DF Analytics: Collapsable sections on results pages (elastic#76641)
  [Fleet] Fix agent policy change action migration (elastic#79046)
  [Ingest Manager] Match package spec `dataset`->`data_stream` and `config_templates`->`policy_templates` renaming (elastic#78699)
  Revert "[Metrics UI] Add ability to override datafeeds and job config for partition field (elastic#78875)"
  [ML] Update transform cloning to include description and new fields (elastic#78364)
  chore(NA): remove non existing plugin paths from case api integration tests (elastic#79127)
  [Ingest Manager] Ensure we trigger agent policy updated event when we bump revision. (elastic#78836)
  [Metrics UI] Display No Data context.values as [NO DATA] (elastic#78038)
  [Monitoring] Missing data alert (elastic#78208)
  [Lens] Fix embeddable title and description for reporting and dashboard tooltip (elastic#78767)
  [Lens] Consistent Drag and Drop styles (elastic#78674)
  [ML] Model management UI fixes and enhancements (elastic#79072)
  [Metrics UI] Add ability to override datafeeds and job config for partition field (elastic#78875)
  [Security Solution]Fix basepath used by endpoint telemetry tests (elastic#79027)
  update rum agent version which contains longtasks (elastic#79105)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Fixes for quality problems that affect the customer experience release_note:skip Skip the PR/issue when compiling release notes 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.

4 participants