Skip to content

Commit 6fe5ec7

Browse files
fix: improves the ui message when an operation is terminated due to controller sync timeout (cherry-pick #23657) (#23672)
Signed-off-by: Patroklos Papapetrou <[email protected]> Co-authored-by: Papapetrou Patroklos <[email protected]>
1 parent 6142c5b commit 6fe5ec7

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

controller/appcontroller.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1483,7 +1483,7 @@ func (ctrl *ApplicationController) processRequestedAppOperation(app *appv1.Appli
14831483
} else {
14841484
state.Phase = synccommon.OperationRunning
14851485
state.RetryCount++
1486-
state.Message = fmt.Sprintf("%s. Retrying attempt #%d at %s.", state.Message, state.RetryCount, retryAt.Format(time.Kitchen))
1486+
state.Message = fmt.Sprintf("%s due to application controller sync timeout. Retrying attempt #%d at %s.", state.Message, state.RetryCount, retryAt.Format(time.Kitchen))
14871487
}
14881488
} else if state.RetryCount > 0 {
14891489
state.Message = fmt.Sprintf("%s (retried %d times).", state.Message, state.RetryCount)

controller/appcontroller_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2090,7 +2090,7 @@ func TestProcessRequestedAppOperation_FailedHasRetries(t *testing.T) {
20902090
phase, _, _ := unstructured.NestedString(receivedPatch, "status", "operationState", "phase")
20912091
assert.Equal(t, string(synccommon.OperationRunning), phase)
20922092
message, _, _ := unstructured.NestedString(receivedPatch, "status", "operationState", "message")
2093-
assert.Contains(t, message, "Retrying attempt #1")
2093+
assert.Contains(t, message, "due to application controller sync timeout. Retrying attempt #1")
20942094
retryCount, _, _ := unstructured.NestedFloat64(receivedPatch, "status", "operationState", "retryCount")
20952095
assert.InEpsilon(t, float64(1), retryCount, 0.0001)
20962096
}

0 commit comments

Comments
 (0)