-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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] Support limiting integrations on an agent config #70542
Merged
jen-huang
merged 20 commits into
elastic:master
from
jen-huang:ingest/limit-integrations
Jul 6, 2020
Merged
Changes from 14 commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
8439e2a
Add API endpoint and hook for retrieving restricted packages
jen-huang 0a2009b
Filter out restricted packages already in use from list of integratio…
jen-huang 7deee92
Allow list agent configs to optionally return expanded package config…
jen-huang 845b7ed
Filter out agent configs which already use the restricted package alr…
jen-huang d9a59ea
Allow more than 20 agent configs to be shown
jen-huang 03aa609
Rename restricted to limited; add some common methods to DRY
jen-huang f307922
Add limited package check on server side
jen-huang a44ec20
Adjust copy wording
jen-huang 441f331
Fix typings
jen-huang e88f80b
Add some package config api integration tests, update es archive mapp…
jen-huang 7da46ac
Move test to dockerized integation tests directory; move existing epm…
jen-huang d32eb27
Merge remote-tracking branch 'upstream/master' into ingest/limit-inte…
jen-huang 6d3006e
Remove extra assignPackageConfigs() - already handled in packageConfi…
jen-huang 0d86922
Merge remote-tracking branch 'upstream/master' into ingest/limit-inte…
jen-huang 18a72f3
Merge remote-tracking branch 'upstream/master' into ingest/limit-inte…
jen-huang b4e522f
Review fixes
jen-huang cdef2b6
Merge remote-tracking branch 'upstream/master' into ingest/limit-inte…
jen-huang c18ec76
Fix type, reenabled skipped test
jen-huang 2c13944
Merge remote-tracking branch 'upstream/master' into ingest/limit-inte…
jen-huang fa768a1
Move new EPM integration test file
jen-huang File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
x-pack/plugins/ingest_manager/common/services/limited_package.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License; | ||
* you may not use this file except in compliance with the Elastic License. | ||
*/ | ||
import { PackageInfo, AgentConfig, PackageConfig } from '../types'; | ||
|
||
// Assume packages only ever include 1 config template for now | ||
export const isPackageLimited = (packageInfo: PackageInfo): boolean => { | ||
return packageInfo.config_templates?.[0]?.multiple === false; | ||
}; | ||
|
||
export const doesAgentConfigAlreadyIncludePackage = ( | ||
agentConfig: AgentConfig, | ||
packageName: string | ||
): boolean => { | ||
if (agentConfig.package_configs.length && typeof agentConfig.package_configs[0] === 'string') { | ||
throw new Error('Unable to read full package config information'); | ||
} | ||
return (agentConfig.package_configs as PackageConfig[]) | ||
.map((packageConfig) => packageConfig.package?.name || '') | ||
.includes(packageName); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need this? It appears unused
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bad merge :)