mirror of
https://github.com/elastic/kibana.git
synced 2025-06-27 10:40:07 -04:00
## Summary Closes https://github.com/elastic/ingest-dev/issues/5694 - Adds a feature flag gate for the `single` agent migration UI and API - Also gates the bulk migrate `endpoint`, UI will be gated separately as part of https://github.com/elastic/kibana/pull/224334 ### Checklist Check the PR satisfies following conditions. Reviewers should verify this PR satisfies this list as well. - [ ] Any text added follows [EUI's writing guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses sentence case text and includes [i18n support](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md) - [ ] [Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html) was added for features that require explanation or tutorials - [ ] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios - [ ] If a plugin configuration key changed, check if it needs to be allowlisted in the cloud and added to the [docker list](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker) - [ ] This was checked for breaking HTTP API changes, and any breaking changes have been approved by the breaking-change committee. The `release_note:breaking` label should be applied in these situations. - [ ] [Flaky Test Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was used on any tests changed - [ ] The PR description includes the appropriate Release Notes section, and the correct `release_note:*` label is applied per the [guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process) ### Identify risks N/A --------- Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com> Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
114 lines
4.6 KiB
TypeScript
114 lines
4.6 KiB
TypeScript
/*
|
|
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
* or more contributor license agreements. Licensed under the Elastic License
|
|
* 2.0; you may not use this file except in compliance with the Elastic License
|
|
* 2.0.
|
|
*/
|
|
|
|
import path from 'path';
|
|
|
|
import {
|
|
fleetPackageRegistryDockerImage,
|
|
FtrConfigProviderContext,
|
|
defineDockerServersConfig,
|
|
getKibanaCliLoggers,
|
|
} from '@kbn/test';
|
|
import { ScoutTestRunConfigCategory } from '@kbn/scout-info';
|
|
import { CA_CERT_PATH, KBN_CERT_PATH, KBN_KEY_PATH } from '@kbn/dev-utils';
|
|
|
|
const getFullPath = (relativePath: string) => path.join(path.dirname(__filename), relativePath);
|
|
|
|
export const BUNDLED_PACKAGE_DIR = '/tmp/fleet_bundled_packages';
|
|
|
|
export default async function ({ readConfigFile, log }: FtrConfigProviderContext) {
|
|
const xPackAPITestsConfig = await readConfigFile(require.resolve('../api_integration/config.ts'));
|
|
|
|
const registryPort: string | undefined = process.env.FLEET_PACKAGE_REGISTRY_PORT;
|
|
const skipRunningDockerRegistry =
|
|
process.env.FLEET_SKIP_RUNNING_PACKAGE_REGISTRY === 'true' ? true : false;
|
|
|
|
// mount the config file for the package registry as well as
|
|
// the directories containing additional packages into the container
|
|
const volumes = {
|
|
// src : dest
|
|
'./apis/fixtures/package_registry_config.yml': '/package-registry/config.yml',
|
|
'./apis/fixtures/test_packages': '/packages/test-packages',
|
|
'./apis/fixtures/package_verification/packages/zips': '/packages/signed-test-packages',
|
|
};
|
|
const dockerArgs: string[] = Object.entries(volumes).flatMap(([src, dest]) => [
|
|
'-v',
|
|
`${getFullPath(src)}:${dest}`,
|
|
]);
|
|
|
|
const dockerServers = !skipRunningDockerRegistry
|
|
? defineDockerServersConfig({
|
|
registry: {
|
|
enabled: !!registryPort,
|
|
image: fleetPackageRegistryDockerImage,
|
|
portInContainer: 8080,
|
|
port: registryPort,
|
|
args: dockerArgs,
|
|
waitForLogLine: 'package manifests loaded',
|
|
waitForLogLineTimeoutMs: 60 * 4 * 1000, // 4 minutes
|
|
},
|
|
})
|
|
: undefined;
|
|
|
|
if (skipRunningDockerRegistry) {
|
|
const cmd = `docker run ${dockerArgs.join(
|
|
' '
|
|
)} -p ${registryPort}:8080 ${fleetPackageRegistryDockerImage}`;
|
|
log.warning(`Not running docker registry, you can run it with the following command: ${cmd}`);
|
|
}
|
|
|
|
return {
|
|
testConfigCategory: ScoutTestRunConfigCategory.API_TEST,
|
|
servers: xPackAPITestsConfig.get('servers'),
|
|
dockerServers,
|
|
services: xPackAPITestsConfig.get('services'),
|
|
esTestCluster: {
|
|
...xPackAPITestsConfig.get('esTestCluster'),
|
|
serverArgs: [...xPackAPITestsConfig.get('esTestCluster.serverArgs'), 'http.host=0.0.0.0'],
|
|
},
|
|
kbnTestServer: {
|
|
...xPackAPITestsConfig.get('kbnTestServer'),
|
|
serverArgs: [
|
|
...xPackAPITestsConfig.get('kbnTestServer.serverArgs'),
|
|
// always install Endpoint package by default when Fleet sets up
|
|
`--xpack.fleet.packages.0.name=endpoint`,
|
|
`--xpack.fleet.packages.0.version=latest`,
|
|
...(registryPort ? [`--xpack.fleet.registryUrl=http://localhost:${registryPort}`] : []),
|
|
`--xpack.fleet.developer.bundledPackageLocation=${BUNDLED_PACKAGE_DIR}`,
|
|
`--xpack.fleet.developer.disableBundledPackagesCache=true`,
|
|
'--xpack.cloudSecurityPosture.enabled=true',
|
|
`--xpack.fleet.developer.maxAgentPoliciesWithInactivityTimeout=10`,
|
|
`--xpack.fleet.packageVerification.gpgKeyPath=${getFullPath(
|
|
'./apis/fixtures/package_verification/signatures/fleet_test_key_public.asc'
|
|
)}`,
|
|
`--xpack.securitySolution.enableExperimental=${JSON.stringify(['endpointRbacEnabled'])}`,
|
|
`--xpack.fleet.enableExperimental=${JSON.stringify([
|
|
'enableAutomaticAgentUpgrades',
|
|
'enableAgentMigrations',
|
|
])}`,
|
|
`--xpack.cloud.id='123456789'`,
|
|
`--xpack.fleet.agentless.enabled=true`,
|
|
`--xpack.fleet.agentless.api.url=http://localhost:8089/agentless-api`,
|
|
`--xpack.fleet.agentless.api.tls.certificate=${KBN_CERT_PATH}`,
|
|
`--xpack.fleet.agentless.api.tls.key=${KBN_KEY_PATH}`,
|
|
`--xpack.fleet.agentless.api.tls.ca=${CA_CERT_PATH}`,
|
|
`--xpack.fleet.internal.registry.kibanaVersionCheckEnabled=false`,
|
|
`--xpack.fleet.internal.registry.spec.min=1.0`,
|
|
`--logging.loggers=${JSON.stringify([
|
|
...getKibanaCliLoggers(xPackAPITestsConfig.get('kbnTestServer.serverArgs')),
|
|
|
|
// Enable debug fleet logs by default
|
|
{
|
|
name: 'plugins.fleet',
|
|
level: 'debug',
|
|
appenders: ['default'],
|
|
},
|
|
])}`,
|
|
],
|
|
},
|
|
};
|
|
}
|