Skip to content

Fix error swallowing in workbenches component status update #2403

@coderabbitai

Description

@coderabbitai

Problem

In internal/controller/components/workbenches/workbenches.go at lines 143-145, the code incorrectly swallows client.Get errors by returning nil instead of propagating them:

if err := rr.Client.Get(ctx, client.ObjectKeyFromObject(&c), &c); err != nil && !k8serr.IsNotFound(err) {
    return cs, nil  // <- This hides real errors
}

This masks genuine failures and makes debugging difficult in production environments.

Suggested Fix

if err := rr.Client.Get(ctx, client.ObjectKeyFromObject(&c), &c); err != nil && !k8serr.IsNotFound(err) {
    return cs, err  // <- Properly bubble up the error
}

Context

Originally identified during code review of PR #2402: #2402 (comment)

/cc @jiridanek

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions