Skip to content

Commit

Permalink
[Fleet] remove internal params when querying registry (elastic#118693)
Browse files Browse the repository at this point in the history
* removed internal param

* fixed tests

* fixed tests
  • Loading branch information
juliaElastic authored and TinLe committed Nov 20, 2021
1 parent 4c61b48 commit 1f63692
Show file tree
Hide file tree
Showing 7 changed files with 3 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ const optionalArchivePackageProps: readonly OptionalPackageProp[] = [
'readme',
'assets',
'data_streams',
'internal',
'license',
'type',
'categories',
Expand Down
6 changes: 1 addition & 5 deletions x-pack/plugins/fleet/server/services/epm/packages/get.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,15 +54,11 @@ export async function getPackages(
});
// get the installed packages
const packageSavedObjects = await getPackageSavedObjects(savedObjectsClient);
// filter out any internal packages
const savedObjectsVisible = packageSavedObjects.saved_objects.filter(
(o) => !o.attributes.internal
);
const packageList = registryItems
.map((item) =>
createInstallableFrom(
item,
savedObjectsVisible.find(({ id }) => id === item.name)
packageSavedObjects.saved_objects.find(({ id }) => id === item.name)
)
)
.sort(sortByName);
Expand Down
3 changes: 1 addition & 2 deletions x-pack/plugins/fleet/server/services/epm/packages/install.ts
Original file line number Diff line number Diff line change
Expand Up @@ -530,7 +530,7 @@ export async function createInstallation(options: {
installSource: InstallSource;
}) {
const { savedObjectsClient, packageInfo, installSource } = options;
const { internal = false, name: pkgName, version: pkgVersion } = packageInfo;
const { name: pkgName, version: pkgVersion } = packageInfo;
const removable = !isUnremovablePackage(pkgName);
const toSaveESIndexPatterns = generateESIndexPatterns(packageInfo.data_streams);

Expand All @@ -549,7 +549,6 @@ export async function createInstallation(options: {
es_index_patterns: toSaveESIndexPatterns,
name: pkgName,
version: pkgVersion,
internal,
removable,
install_version: pkgVersion,
install_status: 'installing',
Expand Down
4 changes: 1 addition & 3 deletions x-pack/plugins/fleet/server/services/epm/registry/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,7 @@ export async function fetchList(params?: SearchParams): Promise<RegistrySearchRe

export async function fetchFindLatestPackage(packageName: string): Promise<RegistrySearchResult> {
const registryUrl = getRegistryUrl();
const url = new URL(
`${registryUrl}/search?package=${packageName}&internal=true&experimental=true`
);
const url = new URL(`${registryUrl}/search?package=${packageName}&experimental=true`);

setKibanaVersion(url);

Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -668,7 +668,6 @@ const expectAssetsInstalled = ({
],
name: 'all_assets',
version: '0.1.0',
internal: false,
removable: true,
install_version: '0.1.0',
install_status: 'installed',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -457,7 +457,6 @@ export default function (providerContext: FtrProviderContext) {
],
name: 'all_assets',
version: '0.2.0',
internal: false,
removable: true,
install_version: '0.2.0',
install_status: 'installed',
Expand Down

0 comments on commit 1f63692

Please sign in to comment.