Skip to content

Commit cdff378

Browse files
authored
fix: return correct error on diagaction ctx deadline exceeded (#5417)
swap errors.Is arg
1 parent 48f2c7a commit cdff378

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pkg/component/runtime/manager.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1058,7 +1058,7 @@ func (m *Manager) performDiagAction(ctx context.Context, comp component.Componen
10581058
res, err := runtime.performAction(ctx, req)
10591059
// the only way this can return an error is a context Done(), be sure to make that explicit.
10601060
if err != nil {
1061-
if errors.Is(context.DeadlineExceeded, err) {
1061+
if errors.Is(err, context.DeadlineExceeded) {
10621062
return nil, fmt.Errorf("diagnostic action timed out, deadline is %s: %w", finalDiagnosticTime, err)
10631063
}
10641064
return nil, fmt.Errorf("error running performAction: %w", err)

0 commit comments

Comments
 (0)