Skip to content

Commit bff0857

Browse files
committed
progressing condition timeout should be a constant
1 parent 51232b7 commit bff0857

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

pkg/operator/v1helpers/helpers.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@ import (
2323
"sigs.k8s.io/yaml"
2424
)
2525

26+
const (
27+
progressingConditionTimeout = 15 * time.Minute
28+
)
29+
2630
// SetOperandVersion sets the new version and returns the previous value.
2731
func SetOperandVersion(versions *[]configv1.OperandVersion, operandVersion configv1.OperandVersion) string {
2832
if versions == nil {
@@ -555,5 +559,5 @@ func IsConditionPresentAndEqual(conditions []metav1.Condition, conditionType str
555559
// it returns true if the progressing condition has been set to True for at least 15 minutes
556560
func IsUpdatingTooLong(operatorStatus *operatorv1.OperatorStatus, progressingConditionType string) (bool, error) {
557561
progressing := FindOperatorCondition(operatorStatus.Conditions, progressingConditionType)
558-
return progressing != nil && progressing.Status == operatorv1.ConditionTrue && time.Now().After(progressing.LastTransitionTime.Add(15*time.Minute)), nil
562+
return progressing != nil && progressing.Status == operatorv1.ConditionTrue && time.Now().After(progressing.LastTransitionTime.Add(progressingConditionTimeout)), nil
559563
}

0 commit comments

Comments
 (0)