Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEATURE] Enhance StatusAnalyzer to Provide Reason and Message for Kubernetes Resource Status Interpretation #245

Open
Avenel opened this issue Mar 5, 2025 · 0 comments

Comments

@Avenel
Copy link

Avenel commented Mar 5, 2025

Is your feature request related to a problem? Please describe.
Currently, the StatusAnalyzer in the component-operator-runtime interprets the status conditions of a Kubernetes resource and returns a status. However, it does not provide additional context such as a reason or message that explains how the status was determined. This lack of information can be frustrating when trying to understand the status of a resource.

Describe the solution you'd like
I would like the StatusAnalyzer to return additional information, such as a reason or message, when computing the status of a resource. This could be achieved by having the StatusAnalyzer return the condition it used to interpret the status or by rendering an object with a structure that includes a message: string and reason: string.

Describe alternatives you've considered
An alternative solution could be to manually extract and interpret the conditions from the resource status, but this approach would be less efficient and more error-prone.

Additional context
The current implementation of the StatusAnalyzer is as follows:

statusAnalyzer := componentruntimestatus.NewStatusAnalyzer(reflect.TypeOf(r).Name())
status, err := statusAnalyzer.ComputeStatus(observedResource)
if err != nil {
    return errors.Wrap(err, "error computing status")
}

resource.Status.SetCondition(MyCondition{
    Type:   MyStatus,
    Status: status.String(),

    // it would be nice to render the reason and/or message as well
    Reason: status.context?.reason,
    Message: status.context?.message
})

This enhancement would provide more clarity and context when analyzing the status of Kubernetes resources.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant