-
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] Kibana, not EPR, controls removable packages #69761
Changes from 3 commits
70b804c
5bdf8c8
fe84f9c
6662200
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1712,6 +1712,198 @@ | |
}, | ||
"success": true | ||
} | ||
}, | ||
"required-package": { | ||
"value": { | ||
"response": { | ||
"format_version": "1.0.0", | ||
"name": "endpoint", | ||
"title": "Elastic Endpoint", | ||
"version": "0.3.0", | ||
"readme": "/package/endpoint/0.3.0/docs/README.md", | ||
"license": "basic", | ||
"description": "This is the Elastic Endpoint package.", | ||
"type": "solution", | ||
"categories": [ | ||
"security" | ||
], | ||
"release": "beta", | ||
"requirement": { | ||
"kibana": { | ||
"versions": ">7.4.0" | ||
} | ||
}, | ||
"icons": [ | ||
{ | ||
"src": "/package/endpoint/0.3.0/img/logo-endpoint-64-color.svg", | ||
"size": "16x16", | ||
"type": "image/svg+xml" | ||
} | ||
], | ||
"assets": { | ||
"kibana": { | ||
"dashboard": [ | ||
{ | ||
"pkgkey": "endpoint-0.3.0", | ||
"service": "kibana", | ||
"type": "dashboard", | ||
"file": "826759f0-7074-11ea-9bc8-6b38f4d29a16.json", | ||
"path": "endpoint-0.3.0/kibana/dashboard/826759f0-7074-11ea-9bc8-6b38f4d29a16.json" | ||
} | ||
], | ||
"map": [ | ||
{ | ||
"pkgkey": "endpoint-0.3.0", | ||
"service": "kibana", | ||
"type": "map", | ||
"file": "a3a3bd10-706b-11ea-9bc8-6b38f4d29a16.json", | ||
"path": "endpoint-0.3.0/kibana/map/a3a3bd10-706b-11ea-9bc8-6b38f4d29a16.json" | ||
} | ||
], | ||
"visualization": [ | ||
{ | ||
"pkgkey": "endpoint-0.3.0", | ||
"service": "kibana", | ||
"type": "visualization", | ||
"file": "1cfceda0-728b-11ea-9bc8-6b38f4d29a16.json", | ||
"path": "endpoint-0.3.0/kibana/visualization/1cfceda0-728b-11ea-9bc8-6b38f4d29a16.json" | ||
}, | ||
{ | ||
"pkgkey": "endpoint-0.3.0", | ||
"service": "kibana", | ||
"type": "visualization", | ||
"file": "1e525190-7074-11ea-9bc8-6b38f4d29a16.json", | ||
"path": "endpoint-0.3.0/kibana/visualization/1e525190-7074-11ea-9bc8-6b38f4d29a16.json" | ||
}, | ||
{ | ||
"pkgkey": "endpoint-0.3.0", | ||
"service": "kibana", | ||
"type": "visualization", | ||
"file": "55387750-729c-11ea-9bc8-6b38f4d29a16.json", | ||
"path": "endpoint-0.3.0/kibana/visualization/55387750-729c-11ea-9bc8-6b38f4d29a16.json" | ||
}, | ||
{ | ||
"pkgkey": "endpoint-0.3.0", | ||
"service": "kibana", | ||
"type": "visualization", | ||
"file": "92b1edc0-706a-11ea-9bc8-6b38f4d29a16.json", | ||
"path": "endpoint-0.3.0/kibana/visualization/92b1edc0-706a-11ea-9bc8-6b38f4d29a16.json" | ||
} | ||
] | ||
} | ||
}, | ||
"datasets": [ | ||
{ | ||
"id": "endpoint", | ||
"title": "Endpoint Events", | ||
"release": "experimental", | ||
"type": "events", | ||
"package": "endpoint", | ||
"path": "events" | ||
}, | ||
{ | ||
"id": "endpoint.metadata", | ||
"title": "Endpoint Metadata", | ||
"release": "experimental", | ||
"type": "metrics", | ||
"package": "endpoint", | ||
"path": "metadata" | ||
}, | ||
{ | ||
"id": "endpoint.policy", | ||
"title": "Endpoint Policy Response", | ||
"release": "experimental", | ||
"type": "metrics", | ||
"package": "endpoint", | ||
"path": "policy" | ||
}, | ||
{ | ||
"id": "endpoint.telemetry", | ||
"title": "Endpoint Telemetry", | ||
"release": "experimental", | ||
"type": "metrics", | ||
"package": "endpoint", | ||
"path": "telemetry" | ||
} | ||
], | ||
"datasources": [ | ||
{ | ||
"name": "endpoint", | ||
"title": "Endpoint data source", | ||
"description": "Interact with the endpoint.", | ||
"inputs": null, | ||
"multiple": false | ||
} | ||
], | ||
"download": "/epr/endpoint/endpoint-0.3.0.tar.gz", | ||
"path": "/package/endpoint/0.3.0", | ||
"latestVersion": "0.3.0", | ||
"removable": false, | ||
"status": "installed", | ||
"savedObject": { | ||
"id": "endpoint", | ||
"type": "epm-packages", | ||
"updated_at": "2020-06-23T21:44:59.319Z", | ||
"version": "Wzk4LDFd", | ||
"attributes": { | ||
"installed": [ | ||
{ | ||
"id": "826759f0-7074-11ea-9bc8-6b38f4d29a16", | ||
"type": "dashboard" | ||
}, | ||
{ | ||
"id": "1cfceda0-728b-11ea-9bc8-6b38f4d29a16", | ||
"type": "visualization" | ||
}, | ||
{ | ||
"id": "1e525190-7074-11ea-9bc8-6b38f4d29a16", | ||
"type": "visualization" | ||
}, | ||
{ | ||
"id": "55387750-729c-11ea-9bc8-6b38f4d29a16", | ||
"type": "visualization" | ||
}, | ||
{ | ||
"id": "92b1edc0-706a-11ea-9bc8-6b38f4d29a16", | ||
"type": "visualization" | ||
}, | ||
{ | ||
"id": "a3a3bd10-706b-11ea-9bc8-6b38f4d29a16", | ||
"type": "map" | ||
}, | ||
{ | ||
"id": "events-endpoint", | ||
"type": "index-template" | ||
}, | ||
{ | ||
"id": "metrics-endpoint.metadata", | ||
"type": "index-template" | ||
}, | ||
{ | ||
"id": "metrics-endpoint.policy", | ||
"type": "index-template" | ||
}, | ||
{ | ||
"id": "metrics-endpoint.telemetry", | ||
"type": "index-template" | ||
} | ||
], | ||
"es_index_patterns": { | ||
"events": "events-endpoint-*", | ||
"metadata": "metrics-endpoint.metadata-*", | ||
"policy": "metrics-endpoint.policy-*", | ||
"telemetry": "metrics-endpoint.telemetry-*" | ||
}, | ||
"name": "endpoint", | ||
"version": "0.3.0", | ||
"internal": false, | ||
"removable": false | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. is a required package |
||
}, | ||
"references": [] | ||
} | ||
}, | ||
"success": true | ||
} | ||
} | ||
} | ||
} | ||
|
@@ -3822,6 +4014,9 @@ | |
}, | ||
"path": { | ||
"type": "string" | ||
}, | ||
"removable": { | ||
"type": "boolean" | ||
} | ||
}, | ||
"required": [ | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -58,7 +58,6 @@ export interface RegistryPackage { | |
icons?: RegistryImage[]; | ||
assets?: string[]; | ||
internal?: boolean; | ||
removable?: boolean; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No longer coming from the Registry so remove from its type |
||
format_version: string; | ||
datasets?: Dataset[]; | ||
datasources?: RegistryDatasource[]; | ||
|
@@ -206,6 +205,7 @@ interface PackageAdditions { | |
title: string; | ||
latestVersion: string; | ||
assets: AssetsGroupedByServiceByType; | ||
removable?: boolean; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Add to Ingest's Package type |
||
} | ||
|
||
// Managers public HTTP response types | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,6 +26,16 @@ export { | |
export { installKibanaAssets, installPackage, ensureInstalledPackage } from './install'; | ||
export { removeInstallation } from './remove'; | ||
|
||
type RequiredPackage = 'system' | 'endpoint'; | ||
const requiredPackages: Record<RequiredPackage, boolean> = { | ||
system: true, | ||
endpoint: true, | ||
}; | ||
|
||
export function isRequiredPackage(value: string): value is RequiredPackage { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This tests based only on the package name, not name + version. We can add versions in later if we need to There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ++ |
||
return value in requiredPackages; | ||
} | ||
|
||
export class PackageNotInstalledError extends Error { | ||
constructor(pkgkey: string) { | ||
super(`${pkgkey} is not installed`); | ||
|
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.
Added an example for a package which has
removable: false