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

[Fleet] Fix uninstall package validation accross space #188749

Merged
merged 8 commits into from
Jul 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions x-pack/plugins/fleet/common/types/models/epm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -533,6 +533,10 @@ export type PackageInfo =
| Installable<Merge<RegistryPackage, EpmPackageAdditions>>
| Installable<Merge<ArchivePackage, EpmPackageAdditions>>;

export interface PackageMetadata {
has_policies: true;
}

export type IntegrationCardReleaseLabel = 'beta' | 'preview' | 'ga' | 'rc';

export type PackageVerificationStatus = 'verified' | 'unverified' | 'unknown';
Expand Down
2 changes: 2 additions & 0 deletions x-pack/plugins/fleet/common/types/rest_spec/epm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import type {
SimpleSOAssetType,
AssetSOObject,
InstallResultStatus,
PackageMetadata,
} from '../models/epm';

export interface GetCategoriesRequest {
Expand Down Expand Up @@ -97,6 +98,7 @@ export interface GetInfoRequest {

export interface GetInfoResponse {
item: PackageInfo;
metadata?: PackageMetadata;
// deprecated in 8.0
response?: PackageInfo;
}
Expand Down
1 change: 1 addition & 0 deletions x-pack/plugins/fleet/cypress/e2e/install_assets.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ describe('Install unverified package assets', () => {
if (res.body?.item?.status) {
res.body.item.status = 'not_installed';
}
res.body.metadata = { has_policies: false };
});
});
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,7 @@ export function Detail() {
pkgVersion,
{
prerelease: prereleaseIntegrationsEnabled,
withMetadata: true,
},
{
enabled: !authz.fleet.readSettings || !isSettingsInitialLoading, // Load only after settings are loaded
Expand Down Expand Up @@ -785,7 +786,11 @@ export function Detail() {
/>
</Route>
<Route path={INTEGRATIONS_ROUTING_PATHS.integration_details_settings}>
<SettingsPage packageInfo={packageInfo} startServices={services} />
<SettingsPage
packageInfo={packageInfo}
packageMetadata={packageInfoData?.metadata}
startServices={services}
/>
</Route>
<Route path={INTEGRATIONS_ROUTING_PATHS.integration_details_assets}>
<AssetsPage packageInfo={packageInfo} refetchPackageInfo={refetchPackageInfo} />
Expand Down
Loading
Loading