[Serverless] ES should ignore the version mismatch (#168076)

This commit is contained in:
Alejandro Fernández Haro 2023-10-05 14:27:29 +02:00 committed by GitHub
parent 4f9e2bdf19
commit 5475946662
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 20 additions and 15 deletions

View file

@ -86,6 +86,9 @@ xpack.spaces.allowFeatureVisibility: false
# Only display console autocomplete suggestions for ES endpoints that are available in serverless
console.autocompleteDefinitions.endpointsAvailability: serverless
# Do not check the ES version when running on Serverless
elasticsearch.ignoreVersionMismatch: true
# Allow authentication via the Elasticsearch JWT realm with the `shared_secret` client authentication type.
elasticsearch.requestHeadersWhitelist: ['authorization', 'es-client-authentication']

View file

@ -6,7 +6,7 @@
* Side Public License, v 1.
*/
import { schema, TypeOf } from '@kbn/config-schema';
import { schema, TypeOf, offeringBasedSchema } from '@kbn/config-schema';
import { readPkcs12Keystore, readPkcs12Truststore } from '@kbn/crypto';
import { i18n } from '@kbn/i18n';
import { Duration } from 'moment';
@ -145,20 +145,22 @@ export const configSchema = schema.object({
),
apiVersion: schema.string({ defaultValue: DEFAULT_API_VERSION }),
healthCheck: schema.object({ delay: schema.duration({ defaultValue: 2500 }) }),
ignoreVersionMismatch: schema.conditional(
schema.contextRef('dev'),
false,
schema.boolean({
validate: (rawValue) => {
if (rawValue === true) {
return '"ignoreVersionMismatch" can only be set to true in development mode';
}
},
// When running in serverless mode, default to `true`
defaultValue: schema.contextRef('serverless'),
}),
schema.boolean({ defaultValue: false })
),
ignoreVersionMismatch: offeringBasedSchema({
serverless: schema.boolean({ defaultValue: true }),
traditional: schema.conditional(
schema.contextRef('dev'),
false,
schema.boolean({
validate: (rawValue) => {
if (rawValue === true) {
return '"ignoreVersionMismatch" can only be set to true in development mode';
}
},
defaultValue: false,
}),
schema.boolean({ defaultValue: false })
),
}),
skipStartupConnectionCheck: schema.conditional(
// Using dist over dev because integration_tests run with dev: false,
// and this config is solely introduced to allow some of the integration tests to run without an ES server.