Skip to content

Commit

Permalink
Don't report OperatorExited to ClusterOperator
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
awgreene authored and openshift-cherrypick-robot committed Jan 15, 2021
1 parent 288fca4 commit 0ea95ea
Showing 1 changed file with 2 additions and 16 deletions.
18 changes: 2 additions & 16 deletions pkg/status/status.go
Expand Up @@ -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.
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 0ea95ea

Please sign in to comment.