mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 17:28:26 -04:00
FTR - check ES security before creating system_indices_superuser (#124948)
This PR adds a check if ES security is enabled before creating the system_indices_superuser in the security service.
This commit is contained in:
parent
535acb782c
commit
befefc3347
1 changed files with 10 additions and 0 deletions
|
@ -25,6 +25,16 @@ export async function createSystemIndicesUser(ctx: FtrProviderContext) {
|
|||
|
||||
const es = createEsClientForFtrConfig(config);
|
||||
|
||||
// There are cases where the test config file doesn't have security disabled
|
||||
// but tests are still executed on ES without security. Checking this case
|
||||
// by trying to fetch the users list.
|
||||
try {
|
||||
await es.security.getUser();
|
||||
} catch (error) {
|
||||
log.debug('Could not fetch users, assuming security is disabled');
|
||||
return;
|
||||
}
|
||||
|
||||
log.debug('===============creating system indices role and user===============');
|
||||
|
||||
await es.security.putRole({
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue