[ML] Using mlClient callAsInternalUser in job validation (#67609)

This commit is contained in:
James Gowdy 2020-05-28 18:04:16 +01:00 committed by GitHub
parent 321a10d1df
commit cae6b9e35a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -66,7 +66,7 @@ export function jobValidationRoutes({ router, mlLicense }: RouteInitialization,
let errorResp;
const resp = await estimateBucketSpanFactory(
context.ml!.mlClient.callAsCurrentUser,
context.core.elasticsearch.legacy.client.callAsInternalUser,
context.ml!.mlClient.callAsInternalUser,
mlLicense.isSecurityEnabled() === false
)(request.body)
// this catch gets triggered when the estimation code runs without error
@ -187,7 +187,7 @@ export function jobValidationRoutes({ router, mlLicense }: RouteInitialization,
context.ml!.mlClient.callAsCurrentUser,
request.body,
version,
context.core.elasticsearch.legacy.client.callAsInternalUser,
context.ml!.mlClient.callAsInternalUser,
mlLicense.isSecurityEnabled() === false
);