Commit db6b5e84 authored by Ash McKenzie's avatar Ash McKenzie

Merge branch '208296-fix-es-replicas-validation' into 'master'

Fix ES replicas setting validation

Closes #208296

See merge request gitlab-org/gitlab!26112
parents e205d28f 8e9f85ba
......@@ -46,7 +46,7 @@ module EE
validates :elasticsearch_replicas,
presence: true,
numericality: { only_integer: true, greater_than: 0 }
numericality: { only_integer: true, greater_than_or_equal_to: 0 }
validates :elasticsearch_max_bulk_size_mb,
presence: true,
......
......@@ -36,8 +36,8 @@ describe ApplicationSetting do
it { is_expected.not_to allow_value(-1).for(:elasticsearch_shards) }
it { is_expected.to allow_value(10).for(:elasticsearch_replicas) }
it { is_expected.to allow_value(0).for(:elasticsearch_replicas) }
it { is_expected.not_to allow_value(nil).for(:elasticsearch_replicas) }
it { is_expected.not_to allow_value(0).for(:elasticsearch_replicas) }
it { is_expected.not_to allow_value(1.1).for(:elasticsearch_replicas) }
it { is_expected.not_to allow_value(-1).for(:elasticsearch_replicas) }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment