mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 01:38:56 -04:00
[7.17] Fix upgrade assistant warning for optional roles and roleTemplate properties (#179818) (#180467)
# Backport This will backport the following commits from `main` to `7.17`: - [Fix upgrade assistant warning for optional roles and roleTemplate properties (#179818)](https://github.com/elastic/kibana/pull/179818) <!--- Backport version: 8.9.8 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport)
This commit is contained in:
parent
c97059012a
commit
261bb8eda3
3 changed files with 7 additions and 4 deletions
|
@ -202,8 +202,11 @@ async function getRoleMappingsDeprecations(
|
|||
const roleMappingsWithReportingRole: string[] = Object.entries(roleMappings).reduce(
|
||||
(roleSet, current) => {
|
||||
const [roleName, role] = current;
|
||||
const foundMapping = role.roles.find((roll) => deprecatedRoles.includes(roll));
|
||||
return foundMapping ? [...roleSet, `${roleName}[${foundMapping}]`] : roleSet;
|
||||
const foundMapping = role.roles?.find((roll) => deprecatedRoles.includes(roll));
|
||||
if (foundMapping) {
|
||||
roleSet.push(`${roleName}[${foundMapping}]`);
|
||||
}
|
||||
return roleSet;
|
||||
},
|
||||
[] as string[]
|
||||
);
|
||||
|
|
|
@ -160,7 +160,7 @@ async function getRoleMappingsDeprecations(
|
|||
}
|
||||
|
||||
const roleMappingsWithKibanaUserRole = Object.entries(roleMappings)
|
||||
.filter(([, roleMapping]) => roleMapping.roles.includes(KIBANA_USER_ROLE_NAME))
|
||||
.filter(([, roleMapping]) => roleMapping.roles?.includes(KIBANA_USER_ROLE_NAME))
|
||||
.map(([mappingName]) => mappingName);
|
||||
if (roleMappingsWithKibanaUserRole.length === 0) {
|
||||
return [];
|
||||
|
|
|
@ -103,7 +103,7 @@ export function defineKibanaUserRoleDeprecationRoutes({ router, logger }: RouteD
|
|||
}
|
||||
|
||||
const roleMappingsWithKibanaUserRole = Object.entries(roleMappings).filter(([, mapping]) =>
|
||||
mapping.roles.includes(KIBANA_USER_ROLE_NAME)
|
||||
mapping.roles?.includes(KIBANA_USER_ROLE_NAME)
|
||||
);
|
||||
|
||||
if (roleMappingsWithKibanaUserRole.length === 0) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue