Skip to content

Commit

Permalink
fix: Print 'More than one checluster Custom Resource found' warning o…
Browse files Browse the repository at this point in the history
…nly there are more than 1 CR

Signed-off-by: Anatolii Bazko <abazko@redhat.com>
  • Loading branch information
tolusha committed Oct 13, 2021
1 parent fcbc80e commit f90d4ea
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions controllers/che/cheobj_verifier.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{}
}

Expand Down Expand Up @@ -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{}
}

Expand Down

0 comments on commit f90d4ea

Please sign in to comment.