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] Make all saved objects namespace agnostic, move to NP plugin #64360

Merged
merged 6 commits into from
Apr 24, 2020

Conversation

jen-huang
Copy link
Contributor

@jen-huang jen-huang commented Apr 23, 2020

Summary

Note: To test this PR, you will need to clear your ES data and do yarn kbn bootstrap.

1) Commit b6b658e

  • Makes all ingest manager saved object types namespace agnostic, and moves the registration of all types to NP plugin instead of legacy
  • Normalizes the saved object type names and adds prefixes to all of them
    • Rationale for prefixing: we store all our saved objects in .kibana index which has a large number of other types registered to it. datasources and agents as names for example can be ambiguous and may conflict in the future with other apps.
Old SO type name New SO type name
agents fleet-agents
agent_events fleet-agent-events
agent_actions fleet-agent-actions
enrollment_api_keys fleet-enrollment-api-keys
agent_configs ingest-agent-configs
datasources ingest-datasources
outputs ingest-outputs
epm-package epm-packages

2) Commit 0a8d0d3

  • Replaces all hardcoded SO type strings with SO type constants

@jen-huang jen-huang added v8.0.0 release_note:skip Skip the PR/issue when compiling release notes Feature:EPM Fleet team's Elastic Package Manager (aka Integrations) project Feature:Fleet Fleet team's agent central management project v7.8.0 Team:Fleet Team label for Observability Data Collection Fleet team labels Apr 23, 2020
@jen-huang jen-huang requested a review from a team April 23, 2020 20:12
@jen-huang jen-huang self-assigned this Apr 23, 2020
@elasticmachine
Copy link
Contributor

Pinging @elastic/ingest-management (Feature:EPM)

Copy link
Contributor

@jfsiii jfsiii left a comment

Choose a reason for hiding this comment

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

I'm going to pull this down and try it out, but it reads clearly to me. I like the changes to the names and appreciate swapping out the strings with variables 👏

},
},
},
},
};

export function registerSavedObjects(savedObjects: SavedObjectsServiceSetup) {
Object.entries(savedObjectTypes).forEach(([, type]) => {
Copy link
Contributor

Choose a reason for hiding this comment

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

If we don't care about the key, Object.values is also an option.

Copy link
Contributor

@jfsiii jfsiii left a comment

Choose a reason for hiding this comment

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

I checked it out and did several operations (install/uninstall packages, datasources, agents, and agent configs) and everything worked well.

I spot checked a few of the saved objects using the _find API and everything looked as expected.

@jen-huang
Copy link
Contributor Author

@jfsiii Thanks for testing!

@kibanamachine
Copy link
Contributor

💚 Build Succeeded

History

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

@jen-huang jen-huang merged commit 74bf877 into elastic:master Apr 24, 2020
@jen-huang jen-huang deleted the ingest/np-mappings branch April 24, 2020 21:33
jen-huang added a commit to jen-huang/kibana that referenced this pull request Apr 24, 2020
…elastic#64360)

* Move saved object type registration & mapping to NP plugin; normalize and prefix saved object type names

* Replace hardcoded saved object type names with constants

* Adjust output type name

* Review and import fixes

* Update tests, fixtures, and instructions
jen-huang added a commit that referenced this pull request Apr 27, 2020
…#64360) (#64465)

* Move saved object type registration & mapping to NP plugin; normalize and prefix saved object type names

* Replace hardcoded saved object type names with constants

* Adjust output type name

* Review and import fixes

* Update tests, fixtures, and instructions

Co-authored-by: Elastic Machine <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature:EPM Fleet team's Elastic Package Manager (aka Integrations) project Feature:Fleet Fleet team's agent central management project release_note:skip Skip the PR/issue when compiling release notes Team:Fleet Team label for Observability Data Collection Fleet team v7.8.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants