mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 09:48:58 -04:00
[APM][Fleet] deprecation warning is not showing up (#119381)
* fixing deprecation warning * fixing test
This commit is contained in:
parent
718f191099
commit
51f7986242
2 changed files with 13 additions and 4 deletions
|
@ -57,7 +57,13 @@ describe('getDeprecations', () => {
|
|||
cloudSetup: { isCloudEnabled: true } as unknown as CloudSetup,
|
||||
fleet: {
|
||||
start: () => ({
|
||||
agentPolicyService: { get: () => ({ id: 'foo' } as AgentPolicy) },
|
||||
agentPolicyService: {
|
||||
get: () =>
|
||||
({
|
||||
id: 'foo',
|
||||
package_policies: [{ package: { name: 'apm' } }],
|
||||
} as AgentPolicy),
|
||||
},
|
||||
}),
|
||||
} as unknown as APMRouteHandlerResources['plugins']['fleet'],
|
||||
});
|
||||
|
|
|
@ -9,7 +9,10 @@ import { GetDeprecationsContext, DeprecationsDetails } from 'src/core/server';
|
|||
import { i18n } from '@kbn/i18n';
|
||||
import { isEmpty } from 'lodash';
|
||||
import { CloudSetup } from '../../../cloud/server';
|
||||
import { getCloudAgentPolicy } from '../routes/fleet/get_cloud_apm_package_policy';
|
||||
import {
|
||||
getCloudAgentPolicy,
|
||||
getApmPackagePolicy,
|
||||
} from '../routes/fleet/get_cloud_apm_package_policy';
|
||||
import { APMRouteHandlerResources } from '../';
|
||||
|
||||
export function getDeprecations({
|
||||
|
@ -36,12 +39,12 @@ export function getDeprecations({
|
|||
});
|
||||
|
||||
const isCloudEnabled = !!cloudSetup?.isCloudEnabled;
|
||||
const hasAPMPackagePolicy = !isEmpty(getApmPackagePolicy(cloudAgentPolicy));
|
||||
|
||||
const hasCloudAgentPolicy = !isEmpty(cloudAgentPolicy);
|
||||
// TODO: remove when docs support "main"
|
||||
const docBranch = branch === 'main' ? 'master' : branch;
|
||||
|
||||
if (isCloudEnabled && !hasCloudAgentPolicy) {
|
||||
if (isCloudEnabled && !hasAPMPackagePolicy) {
|
||||
deprecations.push({
|
||||
title: i18n.translate('xpack.apm.deprecations.legacyModeTitle', {
|
||||
defaultMessage: 'APM Server running in legacy mode',
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue