From 1aaad8f3be52e87989f74135cc5d6a1466e7f2b7 Mon Sep 17 00:00:00 2001 From: Nizamudeen Date: Tue, 5 Nov 2019 15:25:23 +0530 Subject: [PATCH] ceph: added a check for triggering the orchestration Fix for automatic orchestration triggering even if the cluster CRD is unchanged. Signed-off-by: Nizamudeen --- pkg/operator/ceph/cluster/cluster.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/pkg/operator/ceph/cluster/cluster.go b/pkg/operator/ceph/cluster/cluster.go index 1d8f5d943..9a5484610 100755 --- a/pkg/operator/ceph/cluster/cluster.go +++ b/pkg/operator/ceph/cluster/cluster.go @@ -335,11 +335,13 @@ func clusterChanged(oldCluster, newCluster cephv1.ClusterSpec, clusterRef *clust // resource.Quantity has non-exportable fields, so we use its comparator method resourceQtyComparer := cmp.Comparer(func(x, y resource.Quantity) bool { return x.Cmp(y) == 0 }) diff = cmp.Diff(oldCluster, newCluster, resourceQtyComparer) - logger.Infof("The Cluster CR has changed. diff=%s", diff) }() - return true, diff - } + if diff != "" { + logger.Infof("The Cluster CR has changed. diff=%s", diff) + return true, diff + } + } return false, "" }