Skip to content

Commit

Permalink
remove 'kibana' plugin presence check in so mixin
Browse files Browse the repository at this point in the history
  • Loading branch information
pgayvallet committed Aug 27, 2020
1 parent bb61e29 commit 1742a5f
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 23 deletions.
8 changes: 0 additions & 8 deletions src/legacy/server/saved_objects/saved_objects_mixin.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,6 @@ export function savedObjectsMixin(kbnServer, server) {

server.decorate('server', 'kibanaMigrator', migrator);

const warn = (message) => server.log(['warning', 'saved-objects'], message);
// we use kibana.index which is technically defined in the kibana plugin, so if
// we don't have the plugin (mainly tests) we can't initialize the saved objects
if (!kbnServer.pluginSpecs.some((p) => p.getId() === 'kibana')) {
warn('Saved Objects uninitialized because the Kibana plugin is disabled.');
return;
}

const serializer = kbnServer.newPlatform.start.core.savedObjects.createSerializer();

const createRepository = (callCluster, includedHiddenTypes = []) => {
Expand Down
15 changes: 0 additions & 15 deletions src/legacy/server/saved_objects/saved_objects_mixin.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -161,21 +161,6 @@ describe('Saved Objects Mixin', () => {
};
});

describe('no kibana plugin', () => {
it('should not try to create anything', () => {
mockKbnServer.pluginSpecs.some = () => false;
savedObjectsMixin(mockKbnServer, mockServer);
expect(mockServer.log).toHaveBeenCalledWith(expect.any(Array), expect.any(String));
expect(mockServer.decorate).toHaveBeenCalledWith(
'server',
'kibanaMigrator',
expect.any(Object)
);
expect(mockServer.decorate).toHaveBeenCalledTimes(1);
expect(mockServer.route).not.toHaveBeenCalled();
});
});

describe('Saved object service', () => {
let service;

Expand Down

0 comments on commit 1742a5f

Please sign in to comment.