[Fleet] Fix asset creation during custom integration installation (#174869)

This commit is contained in:
Felix Stürmer 2024-01-17 11:41:34 +01:00 committed by GitHub
parent fed9460c21
commit 964a9804ff
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 23 additions and 7 deletions

View file

@ -88,7 +88,10 @@ const uploadPipeline = (pipelineContent: string | object) => {
}
if (
(await doAnyChangesMatch([/^x-pack\/plugins\/observability_onboarding/])) ||
(await doAnyChangesMatch([
/^x-pack\/plugins\/observability_onboarding/,
/^x-pack\/plugins\/fleet/,
])) ||
GITHUB_PR_LABELS.includes('ci:all-cypress-suites')
) {
pipeline.push(

View file

@ -875,7 +875,7 @@ export async function installCustomPackage(
acc.set(asset.path, asset.content);
return acc;
}, new Map<string, Buffer | undefined>());
const paths = [...Object.keys(assetsMap)];
const paths = [...assetsMap.keys()];
const packageInstallContext: PackageInstallContext = {
assetsMap,

View file

@ -125,17 +125,30 @@ Cypress.Commands.add('deleteIntegration', (integrationName: string) => {
cy.request({
log: false,
method: 'DELETE',
method: 'GET',
url: `${kibanaUrl}/api/fleet/epm/packages/${integrationName}`,
body: {
force: false,
},
headers: {
'kbn-xsrf': 'e2e_test',
'Elastic-Api-Version': '1',
},
auth: { user: 'editor', pass: 'changeme' },
failOnStatusCode: false,
}).then((response) => {
const status = response.body.item?.status;
if (status === 'installed') {
cy.request({
log: false,
method: 'DELETE',
url: `${kibanaUrl}/api/fleet/epm/packages/${integrationName}`,
body: {
force: false,
},
headers: {
'kbn-xsrf': 'e2e_test',
'Elastic-Api-Version': '1',
},
auth: { user: 'editor', pass: 'changeme' },
});
}
});
});