Skip to content

Commit 1100ac2

Browse files
committed
remove unused error and fix docstring for IsUpdatingTooLong helper
1 parent bff0857 commit 1100ac2

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

pkg/operator/apiserver/controller/workload/workload.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@ func (c *Controller) updateOperatorStatus(ctx context.Context, previousStatus *o
291291
// Update is done when all pods have been updated to the latest revision
292292
// and the deployment controller has reported NewReplicaSetAvailable
293293
workloadIsBeingUpdated := !workloadAtHighestGeneration || !hasDeploymentProgressed(workload.Status)
294-
workloadIsBeingUpdatedTooLong, err := v1helpers.IsUpdatingTooLong(previousStatus, *deploymentProgressingCondition.Type)
294+
workloadIsBeingUpdatedTooLong := v1helpers.IsUpdatingTooLong(previousStatus, *deploymentProgressingCondition.Type)
295295
if !workloadAtHighestGeneration {
296296
deploymentProgressingCondition = deploymentProgressingCondition.
297297
WithStatus(operatorv1.ConditionTrue).

pkg/operator/v1helpers/helpers.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -555,9 +555,9 @@ func IsConditionPresentAndEqual(conditions []metav1.Condition, conditionType str
555555
return false
556556
}
557557

558-
// IsUpdatingTooLong determines if updating operands takes too long.
559-
// it returns true if the progressing condition has been set to True for at least 15 minutes
560-
func IsUpdatingTooLong(operatorStatus *operatorv1.OperatorStatus, progressingConditionType string) (bool, error) {
558+
// IsUpdatingTooLong determines if updating operands condition takes too long.
559+
// It returns true if the given condition was found and has been set to True longer than progressingConditionTimeout.
560+
func IsUpdatingTooLong(operatorStatus *operatorv1.OperatorStatus, progressingConditionType string) bool {
561561
progressing := FindOperatorCondition(operatorStatus.Conditions, progressingConditionType)
562-
return progressing != nil && progressing.Status == operatorv1.ConditionTrue && time.Now().After(progressing.LastTransitionTime.Add(progressingConditionTimeout)), nil
562+
return progressing != nil && progressing.Status == operatorv1.ConditionTrue && time.Now().After(progressing.LastTransitionTime.Add(progressingConditionTimeout))
563563
}

0 commit comments

Comments
 (0)