Skip to content

Commit ce77744

Browse files
committed
[Fleet] Fix security solution tag id
1 parent 054cdba commit ce77744

2 files changed

Lines changed: 7 additions & 6 deletions

File tree

x-pack/plugins/fleet/server/services/epm/kibana/assets/tag_assets.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -703,7 +703,7 @@ describe('tagKibanaAssets', () => {
703703
} as any;
704704
const assetTags = [
705705
{
706-
text: 'SecuritySolution',
706+
text: 'Security Solution',
707707
asset_types: ['dashboard'],
708708
},
709709
];
@@ -733,9 +733,9 @@ describe('tagKibanaAssets', () => {
733733
{
734734
color: expect.any(String),
735735
description: 'Tag defined in package-spec',
736-
name: 'SecuritySolution',
736+
name: 'Security Solution',
737737
},
738-
{ id: 'SecuritySolution', overwrite: true, refresh: false }
738+
{ id: 'security-solution-default', overwrite: true, refresh: false }
739739
);
740740
});
741741

x-pack/plugins/fleet/server/services/epm/kibana/assets/tag_assets.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@ const MANAGED_TAG_COLOR = '#0077CC';
3636
const PACKAGE_TAG_COLOR = '#4DD2CA';
3737
const MANAGED_TAG_NAME = 'Managed';
3838
const LEGACY_MANAGED_TAG_ID = 'managed';
39-
const SECURITY_SOLUTION_TAG_ID = 'SecuritySolution';
39+
const SECURITY_SOLUTION_TAG_NAME = 'Security Solution';
40+
const SECURITY_SOLUTION_TAG_ID = 'security-solution-default';
4041

4142
// the tag service only accepts 6-digits hex colors
4243
const TAG_COLORS = [
@@ -61,10 +62,10 @@ const getLegacyPackageTagId = (pkgName: string) => pkgName;
6162
/*
6263
This function is exported via fleet/plugin.ts to make it available to other plugins
6364
The `SecuritySolution` tag is a special case that needs to be handled separately
64-
In that case simply return `SecuritySolution`
65+
In that case return id `security-solution-default`
6566
*/
6667
export const getPackageSpecTagId = (spaceId: string, pkgName: string, tagName: string) => {
67-
if (tagName.toLowerCase() === SECURITY_SOLUTION_TAG_ID.toLowerCase())
68+
if (tagName.toLowerCase() === SECURITY_SOLUTION_TAG_NAME.toLowerCase())
6869
return SECURITY_SOLUTION_TAG_ID;
6970
// UUID v5 needs a namespace (uuid.DNS) to generate a predictable uuid
7071
const uniqueId = uuidv5(`${tagName.toLowerCase()}`, uuidv5.DNS);

0 commit comments

Comments
 (0)