From 0ea95eae3281a60a8536539502ab1e3b9ebbdf63 Mon Sep 17 00:00:00 2001 From: awgreene Date: Fri, 23 Oct 2020 13:51:55 -0400 Subject: [PATCH] Don't report OperatorExited to ClusterOperator Problem: The Marketplace operator should not report that it is in a bad state to Telemeter when it exits gracefully. Solution: No longer report that the operator has exited when the operator shuts down gracefully. --- pkg/status/status.go | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/pkg/status/status.go b/pkg/status/status.go index 98e8e552f..fce821e48 100644 --- a/pkg/status/status.go +++ b/pkg/status/status.go @@ -258,22 +258,7 @@ func (r *reporter) monitorClusterStatus() { } select { case <-r.stopCh: - // If the stopCh is closed, set all ClusterOperatorStatus conditions to false. - reason := "OperatorExited" - msg := "The operator has exited" - conditionListBuilder := clusterStatusListBuilder() - conditionListBuilder(configv1.OperatorProgressing, configv1.ConditionFalse, msg, reason) - conditionListBuilder(configv1.OperatorAvailable, configv1.ConditionFalse, msg, reason) - if operatorUpgradeable { - conditionListBuilder(configv1.OperatorUpgradeable, configv1.ConditionTrue, upgradeableMessage, reason) - } else { - conditionListBuilder(configv1.OperatorUpgradeable, configv1.ConditionFalse, deprecatedAPIMessage, "DeprecatedAPIsInUse") - } - statusConditions := conditionListBuilder(configv1.OperatorDegraded, configv1.ConditionFalse, msg, reason) - statusErr := r.setStatus(statusConditions) - if statusErr != nil { - log.Error("[status] " + statusErr.Error()) - } + log.Info("[status] Operator no longer reporting status") return // Attempt to update the ClusterOperator status whenever the seconds // number of seconds defined by coStatusReportInterval passes. @@ -316,6 +301,7 @@ func (r *reporter) monitorClusterStatus() { } else { conditionListBuilder(configv1.OperatorUpgradeable, configv1.ConditionFalse, deprecatedAPIMessage, "DeprecatedAPIsInUse") } + conditionListBuilder(configv1.OperatorDegraded, configv1.ConditionFalse, fmt.Sprintf("Available release version: %s", r.version), reason) statusConditions := conditionListBuilder(configv1.OperatorAvailable, configv1.ConditionTrue, fmt.Sprintf("Available release version: %s", r.version), reason) statusErr = r.setStatus(statusConditions) break