From a9903ed8d7af3d3edb815fac7324c8d3603f0b2f Mon Sep 17 00:00:00 2001 From: Travis Nielsen Date: Tue, 18 Feb 2020 15:34:01 -0700 Subject: [PATCH] ceph: fix status for EC pool creation Creating an EC pool was succeeding, but then the update to the status was failing because of an incorrect check for changing EC parameters. Now we correctly check if EC parameters are changing unexpectedly. Signed-off-by: Travis Nielsen --- cluster/examples/kubernetes/ceph/pool-ec.yaml | 1 - pkg/operator/ceph/pool/controller.go | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/cluster/examples/kubernetes/ceph/pool-ec.yaml b/cluster/examples/kubernetes/ceph/pool-ec.yaml index e3e550cea..8b0a60c96 100644 --- a/cluster/examples/kubernetes/ceph/pool-ec.yaml +++ b/cluster/examples/kubernetes/ceph/pool-ec.yaml @@ -11,7 +11,6 @@ metadata: spec: # The failure domain will spread the replicas of the data across different failure zones failureDomain: osd - # For an erasure-coded pool, comment out the replicated size above and uncomment the following settings. # Make sure you have enough OSDs to support the replica size or sum of the erasure coding and data chunks. # This is the minimal example that requires only 3 OSDs. erasureCoded: diff --git a/pkg/operator/ceph/pool/controller.go b/pkg/operator/ceph/pool/controller.go index 3ecaa6d3e..bec317f26 100644 --- a/pkg/operator/ceph/pool/controller.go +++ b/pkg/operator/ceph/pool/controller.go @@ -120,7 +120,7 @@ func (c *PoolController) onUpdate(oldObj, newObj interface{}) { updateCephBlockPoolStatus(pool.GetName(), pool.GetNamespace(), k8sutil.FailedStatus, c.context) return } - if pool.Spec.ErasureCoded.CodingChunks != 0 && pool.Spec.ErasureCoded.DataChunks != 0 { + if oldPool.Spec.ErasureCoded.CodingChunks != pool.Spec.ErasureCoded.CodingChunks || oldPool.Spec.ErasureCoded.DataChunks != pool.Spec.ErasureCoded.DataChunks { logger.Errorf("failed to update pool %q. erasurecoded update not allowed", pool.Name) updateCephBlockPoolStatus(pool.GetName(), pool.GetNamespace(), k8sutil.FailedStatus, c.context) return