From 950ee166da36aea38203bd08fcda7ec2fc58b62d Mon Sep 17 00:00:00 2001 From: Jen Huang Date: Wed, 30 Oct 2024 14:22:52 -0700 Subject: [PATCH] [UII] Replace `kibanaVersionCheckEnabled` default value instead of config setting (#198172) ## Summary This PR removes `xpack.fleet.internal.registry.kibanaVersionCheckEnabled: false` from `kibana.yml` in favor of changing the default value that Fleet populates, so that we do not apply the Kibana version constraint to EPR requests for >= 9.0 deployments. Prior to this change, this setting was not applied to ESS deployments as `kibana.yml` is overridden there. I updated the related task in https://github.com/elastic/kibana/issues/192624 to reflect this change. --- config/kibana.yml | 5 -- x-pack/plugins/fleet/server/config.ts | 114 +++++++++++++------------- 2 files changed, 59 insertions(+), 60 deletions(-) diff --git a/config/kibana.yml b/config/kibana.yml index 6c4fb774eb37c..c816337f881d4 100644 --- a/config/kibana.yml +++ b/config/kibana.yml @@ -181,8 +181,3 @@ # Maximum number of documents loaded by each shard to generate autocomplete suggestions. # This value must be a whole number greater than zero. Defaults to 100_000 #unifiedSearch.autocomplete.valueSuggestions.terminateAfter: 100000 - -# Must be removed before v9 release -# Requires all registry packages to add v9 as a compatible semver range -# https://github.com/elastic/kibana/issues/192624 -xpack.fleet.internal.registry.kibanaVersionCheckEnabled: false diff --git a/x-pack/plugins/fleet/server/config.ts b/x-pack/plugins/fleet/server/config.ts index 746498221de55..ab5e06ef03716 100644 --- a/x-pack/plugins/fleet/server/config.ts +++ b/x-pack/plugins/fleet/server/config.ts @@ -201,64 +201,68 @@ export const config: PluginConfigDescriptor = { defaultValue: () => [], }), - internal: schema.maybe( - schema.object({ - disableILMPolicies: schema.boolean({ - defaultValue: false, - }), - fleetServerStandalone: schema.boolean({ - defaultValue: false, - }), - onlyAllowAgentUpgradeToKnownVersions: schema.boolean({ - defaultValue: false, - }), - activeAgentsSoftLimit: schema.maybe( - schema.number({ - min: 0, - }) - ), - retrySetupOnBoot: schema.boolean({ defaultValue: false }), - registry: schema.object( - { - kibanaVersionCheckEnabled: schema.boolean({ defaultValue: true }), - excludePackages: schema.arrayOf(schema.string(), { defaultValue: [] }), - spec: schema.object( - { - min: schema.maybe(schema.string()), - max: schema.string({ defaultValue: REGISTRY_SPEC_MAX_VERSION }), - }, - { - defaultValue: { - max: REGISTRY_SPEC_MAX_VERSION, - }, - } - ), - capabilities: schema.arrayOf( - schema.oneOf([ - // See package-spec for the list of available capiblities https://github.com/elastic/package-spec/blob/dcc37b652690f8a2bca9cf8a12fc28fd015730a0/spec/integration/manifest.spec.yml#L113 - schema.literal('apm'), - schema.literal('enterprise_search'), - schema.literal('observability'), - schema.literal('security'), - schema.literal('serverless_search'), - schema.literal('uptime'), - ]), - { defaultValue: [] } - ), - }, - { - defaultValue: { - kibanaVersionCheckEnabled: true, - capabilities: [], - excludePackages: [], - spec: { + internal: schema.object({ + disableILMPolicies: schema.boolean({ + defaultValue: false, + }), + fleetServerStandalone: schema.boolean({ + defaultValue: false, + }), + onlyAllowAgentUpgradeToKnownVersions: schema.boolean({ + defaultValue: false, + }), + activeAgentsSoftLimit: schema.maybe( + schema.number({ + min: 0, + }) + ), + retrySetupOnBoot: schema.boolean({ defaultValue: false }), + registry: schema.object( + { + // Must be set back to `true` before v9 release + // Requires all registry packages to add v9 as a compatible semver range + // https://github.com/elastic/kibana/issues/192624 + kibanaVersionCheckEnabled: schema.boolean({ defaultValue: false }), + excludePackages: schema.arrayOf(schema.string(), { defaultValue: [] }), + spec: schema.object( + { + min: schema.maybe(schema.string()), + max: schema.string({ defaultValue: REGISTRY_SPEC_MAX_VERSION }), + }, + { + defaultValue: { max: REGISTRY_SPEC_MAX_VERSION, }, + } + ), + capabilities: schema.arrayOf( + schema.oneOf([ + // See package-spec for the list of available capiblities https://github.com/elastic/package-spec/blob/dcc37b652690f8a2bca9cf8a12fc28fd015730a0/spec/integration/manifest.spec.yml#L113 + schema.literal('apm'), + schema.literal('enterprise_search'), + schema.literal('observability'), + schema.literal('security'), + schema.literal('serverless_search'), + schema.literal('uptime'), + ]), + { defaultValue: [] } + ), + }, + { + defaultValue: { + // Must be set back to `true` before v9 release + // Requires all registry packages to add v9 as a compatible semver range + // https://github.com/elastic/kibana/issues/192624 + kibanaVersionCheckEnabled: false, + capabilities: [], + excludePackages: [], + spec: { + max: REGISTRY_SPEC_MAX_VERSION, }, - } - ), - }) - ), + }, + } + ), + }), enabled: schema.boolean({ defaultValue: true }), /** * The max size of the artifacts encoded_size sum in a batch when more than one (there is at least one artifact in a batch).