Introduce higher and lower bounds for the number of instances (#178)

* Introduce higher and lower bounds for the number of instances

Reduce the number of instances to the min_instances if it is lower and
to the max_instances if it is higher. -1 for either of those means there
is no lower or upper bound.

In addition, terminate the operator when there is a nonsense in the
configuration (i.e. max_instances < min_instances).

Reviewed by Jan Mußler and Sergey Dudoladov.
This commit is contained in:
Oleksii Kliukin
2017-12-15 16:02:50 +01:00
committed by GitHub
parent 0e255f82c6
commit bf80f5225e
4 changed files with 46 additions and 2 deletions
+1 -1
View File
@@ -267,7 +267,7 @@ func (c *Cluster) syncStatefulSet() error {
c.logger.Infof("found pods without the statefulset: trigger rolling update")
} else {
// statefulset is alrady there, make sure we use its definition in order to compare with the spec.
// statefulset is already there, make sure we use its definition in order to compare with the spec.
c.Statefulset = sset
desiredSS, err := c.generateStatefulSet(&c.Spec)