Delete dead indices.delete code from v1 migrations (#89059)
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
This commit is contained in:
parent
c74a2b25a6
commit
dcba2ab829
|
@ -18,7 +18,7 @@ export interface CallCluster {
|
|||
(path: 'bulk', opts: { body: object[] }): Promise<BulkResult>;
|
||||
(path: 'count', opts: CountOpts): Promise<{ count: number; _shards: ShardsInfo }>;
|
||||
(path: 'clearScroll', opts: { scrollId: string }): Promise<any>;
|
||||
(path: 'indices.create' | 'indices.delete', opts: IndexCreationOpts): Promise<any>;
|
||||
(path: 'indices.create', opts: IndexCreationOpts): Promise<any>;
|
||||
(path: 'indices.exists', opts: IndexOpts): Promise<boolean>;
|
||||
(path: 'indices.existsAlias', opts: { name: string }): Promise<boolean>;
|
||||
(path: 'indices.get', opts: IndexOpts & Ignorable): Promise<IndicesInfo | NotFound>;
|
||||
|
|
|
@ -107,17 +107,6 @@ describe('ElasticIndex', () => {
|
|||
});
|
||||
});
|
||||
|
||||
describe('deleteIndex', () => {
|
||||
test('calls indices.delete', async () => {
|
||||
await Index.deleteIndex(client, '.lotr');
|
||||
|
||||
expect(client.indices.delete).toHaveBeenCalledTimes(1);
|
||||
expect(client.indices.delete).toHaveBeenCalledWith({
|
||||
index: '.lotr',
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe('claimAlias', () => {
|
||||
test('handles unaliased indices', async () => {
|
||||
client.indices.getAlias.mockResolvedValue(
|
||||
|
|
|
@ -221,10 +221,6 @@ export async function createIndex(
|
|||
});
|
||||
}
|
||||
|
||||
export async function deleteIndex(client: MigrationEsClient, index: string) {
|
||||
await client.indices.delete({ index });
|
||||
}
|
||||
|
||||
/**
|
||||
* Converts an index to an alias. The `alias` parameter is the desired alias name which currently
|
||||
* is a concrete index. This function will reindex `alias` into a new index, delete the `alias`
|
||||
|
|
|
@ -20,7 +20,6 @@ const methods = [
|
|||
'clearScroll',
|
||||
'count',
|
||||
'indices.create',
|
||||
'indices.delete',
|
||||
'indices.deleteTemplate',
|
||||
'indices.get',
|
||||
'indices.getAlias',
|
||||
|
|
Loading…
Reference in a new issue