Skip to content

Commit

Permalink
address @hiddeco feedback
Browse files Browse the repository at this point in the history
Signed-off-by: Kent Rancourt <[email protected]>
  • Loading branch information
krancour committed Dec 5, 2024
1 parent 13a191c commit 743a0d8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions api/v1alpha1/promotion_types_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@ func TestPromotionRetry_GetTimeout(t *testing.T) {
want: ptr.To(time.Hour),
},
{
name: "threshold is not set",
name: "timeout is not set",
retry: &PromotionStepRetry{},
fallback: ptr.To(time.Hour),
want: ptr.To(time.Hour),
},
{
name: "threshold is set",
name: "timeout is set",
retry: &PromotionStepRetry{
Timeout: &metav1.Duration{
Duration: 3 * time.Hour,
Expand Down
5 changes: 3 additions & 2 deletions internal/directives/simple_engine_promote.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,15 +124,16 @@ func (e *SimpleEngine) executeSteps(

if stepExecMeta.Status == kargoapi.PromotionPhaseSucceeded {
stepExecMeta.FinishedAt = ptr.To(metav1.Now())
stepExecMeta.ErrorCount = 0
if healthCheck := result.HealthCheckStep; healthCheck != nil {
healthChecks = append(healthChecks, *healthCheck)

Check warning on line 128 in internal/directives/simple_engine_promote.go

View check run for this annotation

Codecov / codecov/patch

internal/directives/simple_engine_promote.go#L128

Added line #L128 was not covered by tests
}
continue // Move on to the next step
}

// Treat errors and logical failures the same for now.
// TODO(krancour): These may be handled differently in the future.
// TODO(krancour): In the future, we should fail without retry for logical
// failures and unrecoverable errors and retry only those errors with a
// chance of recovery.
if stepExecMeta.Status != kargoapi.PromotionPhaseRunning {
stepExecMeta.ErrorCount++
// Check if the error threshold has been met.
Expand Down

0 comments on commit 743a0d8

Please sign in to comment.