Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions pkg/operator2/operator.go
Original file line number Diff line number Diff line change
Expand Up @@ -260,10 +260,11 @@ func (c *authOperator) Sync(obj metav1.Object) error {
syncErr := c.handleSync(operatorConfigCopy)
// this is a catch all degraded state that we only set when we are otherwise not degraded
globalDegradedErr := syncErr
if isDegraded(operatorConfigCopy) {
const globalDegradedPrefix = "OperatorSync"
if isDegradedIgnoreGlobal(operatorConfigCopy, globalDegradedPrefix) {
globalDegradedErr = nil // unset because we are already degraded for some other reason
}
handleDegraded(operatorConfigCopy, "OperatorSync", globalDegradedErr)
handleDegraded(operatorConfigCopy, globalDegradedPrefix, globalDegradedErr)

if _, _, err := v1helpers.UpdateStatus(c.authOperatorConfigClient, func(status *operatorv1.OperatorStatus) error {
// store a copy of our starting conditions, we need to preserve last transition time
Expand Down
6 changes: 4 additions & 2 deletions pkg/operator2/status.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,11 @@ func handleDegraded(operatorConfig *operatorv1.Authentication, prefix string, er
})
}

func isDegraded(operatorConfig *operatorv1.Authentication) bool {
func isDegradedIgnoreGlobal(operatorConfig *operatorv1.Authentication, prefix string) bool {
globalDegraded := prefix + operatorv1.OperatorStatusTypeDegraded
for _, condition := range operatorConfig.Status.Conditions {
if strings.HasSuffix(condition.Type, operatorv1.OperatorStatusTypeDegraded) &&
if condition.Type != globalDegraded && // we want to know if we are degraded for something other than this
strings.HasSuffix(condition.Type, operatorv1.OperatorStatusTypeDegraded) &&
condition.Status == operatorv1.ConditionTrue {
return true
}
Expand Down