From 258a66554fed4c77dab83a150cc8199a7fecde1f Mon Sep 17 00:00:00 2001 From: travisn Date: Sat, 13 Jul 2019 22:49:14 -0600 Subject: [PATCH] ceph: remove unnecessary CR validation Range checks for CR values are done statically in the CRD for the number of mons. There is no need to check in the code if the mon count is out of range. Signed-off-by: travisn --- pkg/operator/ceph/cluster/controller.go | 9 --------- 1 file changed, 9 deletions(-) diff --git a/pkg/operator/ceph/cluster/controller.go b/pkg/operator/ceph/cluster/controller.go index 2c9cf6047..64519694b 100644 --- a/pkg/operator/ceph/cluster/controller.go +++ b/pkg/operator/ceph/cluster/controller.go @@ -244,15 +244,6 @@ func (c *ClusterController) onAdd(obj interface{}) { c.devicesInUse = true } - if cluster.Spec.Mon.Count <= 0 { - logger.Warningf("mon count is 0 or less, should be at least 1, will use default value of %d", mon.DefaultMonCount) - cluster.Spec.Mon.Count = mon.DefaultMonCount - cluster.Spec.Mon.AllowMultiplePerNode = true - } - if cluster.Spec.Mon.Count > mon.MaxMonCount { - logger.Warningf("mon count is bigger than %d (given: %d), not supported, changing to %d", mon.MaxMonCount, cluster.Spec.Mon.Count, mon.MaxMonCount) - cluster.Spec.Mon.Count = mon.MaxMonCount - } if cluster.Spec.Mon.Count%2 == 0 { logger.Warningf("mon count is even (given: %d), should be uneven, continuing", cluster.Spec.Mon.Count) }