[Fleet] Make the encryptedSavedObject plugin optionnal (#87470)

This commit is contained in:
Nicolas Chaulet 2021-01-06 17:54:56 -04:00 committed by GitHub
parent 6df7498a41
commit 3b602f8668
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 13 additions and 12 deletions

View file

@ -4,8 +4,15 @@
"server": true,
"ui": true,
"configPath": ["xpack", "fleet"],
"requiredPlugins": ["licensing", "data", "encryptedSavedObjects"],
"optionalPlugins": ["security", "features", "cloud", "usageCollection", "home"],
"requiredPlugins": ["licensing", "data"],
"optionalPlugins": [
"security",
"features",
"cloud",
"usageCollection",
"home",
"encryptedSavedObjects"
],
"extraPublicDirs": ["common"],
"requiredBundles": ["kibanaReact", "esUiShared", "home", "infra", "kibanaUtils"]
}

View file

@ -91,12 +91,12 @@ export interface FleetSetupDeps {
}
export interface FleetStartDeps {
encryptedSavedObjects: EncryptedSavedObjectsPluginStart;
encryptedSavedObjects?: EncryptedSavedObjectsPluginStart;
security?: SecurityPluginStart;
}
export interface FleetAppContext {
encryptedSavedObjectsStart: EncryptedSavedObjectsPluginStart;
encryptedSavedObjectsStart?: EncryptedSavedObjectsPluginStart;
encryptedSavedObjectsSetup?: EncryptedSavedObjectsPluginSetup;
security?: SecurityPluginStart;
config$?: Observable<FleetConfigType>;
@ -250,8 +250,7 @@ export class FleetPlugin
// Conditional config routes
if (config.agents.enabled) {
const isESOUsingEphemeralEncryptionKey =
deps.encryptedSavedObjects.usingEphemeralEncryptionKey;
const isESOUsingEphemeralEncryptionKey = !deps.encryptedSavedObjects;
if (isESOUsingEphemeralEncryptionKey) {
if (this.logger) {
this.logger.warn(

View file

@ -22,8 +22,7 @@ export const getFleetStatusHandler: RequestHandler = async (context, request, re
const isProductionMode = appContextService.getIsProductionMode();
const isCloud = appContextService.getCloud()?.isCloudEnabled ?? false;
const isTLSCheckDisabled = appContextService.getConfig()?.agents?.tlsCheckDisabled ?? false;
const isUsingEphemeralEncryptionKey = appContextService.getEncryptedSavedObjectsSetup()
.usingEphemeralEncryptionKey;
const isUsingEphemeralEncryptionKey = !appContextService.getEncryptedSavedObjectsSetup();
const missingRequirements: GetFleetStatusResponse['missing_requirements'] = [];
if (!isAdminUserSetup) {

View file

@ -114,10 +114,6 @@ class AppContextService {
}
public getEncryptedSavedObjectsSetup() {
if (!this.encryptedSavedObjectsSetup) {
throw new Error('encryptedSavedObjectsSetup is not set');
}
return this.encryptedSavedObjectsSetup;
}