From f90d4ea0a1e777934c91c3eafaf2901e739a74dd Mon Sep 17 00:00:00 2001 From: Anatolii Bazko Date: Wed, 13 Oct 2021 11:46:42 +0300 Subject: [PATCH] fix: Print 'More than one checluster Custom Resource found' warning only there are more than 1 CR Signed-off-by: Anatolii Bazko --- controllers/che/cheobj_verifier.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/controllers/che/cheobj_verifier.go b/controllers/che/cheobj_verifier.go index 75bd66ba6a..344678d011 100644 --- a/controllers/che/cheobj_verifier.go +++ b/controllers/che/cheobj_verifier.go @@ -29,7 +29,9 @@ func IsTrustedBundleConfigMap(cl client.Client, watchNamespace string, obj clien checluster, num, _ := util.FindCheClusterCRInNamespace(cl, watchNamespace) if num != 1 { - logrus.Warn("More than one checluster Custom Resource found.") + if num > 1 { + logrus.Warn("More than one checluster Custom Resource found.") + } return false, ctrl.Request{} } @@ -78,7 +80,9 @@ func IsEclipseCheRelatedObj(cl client.Client, watchNamespace string, obj client. checluster, num, _ := util.FindCheClusterCRInNamespace(cl, watchNamespace) if num != 1 { - logrus.Warn("More than one checluster Custom Resource found.") + if num > 1 { + logrus.Warn("More than one checluster Custom Resource found.") + } return false, ctrl.Request{} }