|
258 | 258 | context 'when using the default policy' do |
259 | 259 | context 'with a custom pattern' do |
260 | 260 | let (:settings) { super.merge("ilm_pattern" => "000001")} |
261 | | - it 'should create a write alias' do |
| 261 | + it 'should create a rollover alias' do |
262 | 262 | expect(@es.indices.exists_alias(index: "logstash")).to be_falsey |
263 | 263 | subject.register |
264 | 264 | sleep(1) |
|
275 | 275 | expect{get_policy(@es, LogStash::Outputs::ElasticSearch::DEFAULT_POLICY)}.not_to raise_error |
276 | 276 | end |
277 | 277 |
|
278 | | - it 'should create the default write alias' do |
| 278 | + it 'should create the default rollover alias' do |
279 | 279 | expect(@es.indices.exists_alias(index: "logstash")).to be_falsey |
280 | 280 | subject.register |
281 | 281 | sleep(1) |
|
376 | 376 | context 'with the default template' do |
377 | 377 | let(:expected_index) { "logstash" } |
378 | 378 |
|
379 | | - it 'should create the write alias' do |
| 379 | + it 'should create the rollover alias' do |
380 | 380 | expect(@es.indices.exists_alias(index: expected_index)).to be_falsey |
381 | 381 | subject.register |
382 | 382 | sleep(1) |
|
396 | 396 | end |
397 | 397 |
|
398 | 398 | context 'with a custom template' do |
399 | | - let (:ilm_write_alias) { "custom" } |
400 | | - let (:index) { ilm_write_alias } |
| 399 | + let (:ilm_rollover_alias) { "custom" } |
| 400 | + let (:index) { ilm_rollover_alias } |
401 | 401 | let(:expected_index) { index } |
402 | 402 | let (:settings) { super.merge("ilm_policy" => ilm_policy_name, |
403 | 403 | "template" => template, |
404 | 404 | "template_name" => template_name, |
405 | | - "ilm_write_alias" => ilm_write_alias)} |
| 405 | + "ilm_rollover_alias" => ilm_rollover_alias)} |
406 | 406 | let (:template_name) { "custom" } |
407 | 407 |
|
408 | 408 | if ESHelper.es_version_satisfies?(">= 7.0") |
|
418 | 418 | put_policy(@es,ilm_policy_name, policy) |
419 | 419 | end |
420 | 420 |
|
421 | | - it 'should create the write alias' do |
422 | | - expect(@es.indices.exists_alias(index: ilm_write_alias)).to be_falsey |
| 421 | + it 'should create the rollover alias' do |
| 422 | + expect(@es.indices.exists_alias(index: ilm_rollover_alias)).to be_falsey |
423 | 423 | subject.register |
424 | 424 | sleep(1) |
425 | | - expect(@es.indices.exists_alias(index: ilm_write_alias)).to be_truthy |
426 | | - expect(@es.get_alias(name: ilm_write_alias)).to include("#{ilm_write_alias}-#{todays_date}-000001") |
| 425 | + expect(@es.indices.exists_alias(index: ilm_rollover_alias)).to be_truthy |
| 426 | + expect(@es.get_alias(name: ilm_rollover_alias)).to include("#{ilm_rollover_alias}-#{todays_date}-000001") |
427 | 427 | end |
428 | 428 |
|
429 | | - context 'when the custom write alias already exists' do |
| 429 | + context 'when the custom rollover alias already exists' do |
430 | 430 | it 'should ignore the already exists error' do |
431 | | - expect(@es.indices.exists_alias(index: ilm_write_alias)).to be_falsey |
432 | | - put_alias(@es, "#{ilm_write_alias}-#{todays_date}-000001", ilm_write_alias) |
433 | | - expect(@es.indices.exists_alias(index: ilm_write_alias)).to be_truthy |
| 431 | + expect(@es.indices.exists_alias(index: ilm_rollover_alias)).to be_falsey |
| 432 | + put_alias(@es, "#{ilm_rollover_alias}-#{todays_date}-000001", ilm_rollover_alias) |
| 433 | + expect(@es.indices.exists_alias(index: ilm_rollover_alias)).to be_truthy |
434 | 434 | subject.register |
435 | 435 | sleep(1) |
436 | | - expect(@es.get_alias(name: ilm_write_alias)).to include("#{ilm_write_alias}-#{todays_date}-000001") |
| 436 | + expect(@es.get_alias(name: ilm_rollover_alias)).to include("#{ilm_rollover_alias}-#{todays_date}-000001") |
437 | 437 | end |
438 | 438 |
|
439 | 439 | end |
440 | 440 |
|
441 | 441 | it 'should write the ILM settings into the template' do |
442 | 442 | subject.register |
443 | 443 | sleep(1) |
444 | | - expect(@es.indices.get_template(name: template_name)[template_name]["index_patterns"]).to eq(["#{ilm_write_alias}-*"]) |
| 444 | + expect(@es.indices.get_template(name: template_name)[template_name]["index_patterns"]).to eq(["#{ilm_rollover_alias}-*"]) |
445 | 445 | expect(@es.indices.get_template(name: template_name)[template_name]["settings"]['index']['lifecycle']['name']).to eq(ilm_policy_name) |
446 | | - expect(@es.indices.get_template(name: template_name)[template_name]["settings"]['index']['lifecycle']['rollover_alias']).to eq(ilm_write_alias) |
| 446 | + expect(@es.indices.get_template(name: template_name)[template_name]["settings"]['index']['lifecycle']['rollover_alias']).to eq(ilm_rollover_alias) |
447 | 447 | end |
448 | 448 |
|
449 | 449 | it_behaves_like 'an ILM enabled Logstash' |
|
453 | 453 | context 'with ilm disabled' do |
454 | 454 | let (:ilm_enabled) { false } |
455 | 455 |
|
456 | | - it 'should not create a write alias' do |
| 456 | + it 'should not create a rollover alias' do |
457 | 457 | expect(@es.get_alias).to be_empty |
458 | 458 | subject.register |
459 | 459 | sleep(1) |
|
0 commit comments