operator icon indicating copy to clipboard operation
operator copied to clipboard

Make use of apis.FieldError from knative/pkg while handling errors in Reconcilers

Open nikhil-thomas opened this issue 3 years ago • 2 comments

In tektoncd projects apis.FieldError are used extensively in error handling (especially in validation).

From knative documentation.

// FieldError is used to propagate the context of errors pertaining to
// specific fields in a manner suitable for use in a recursive walk, so
// that errors contain the appropriate field context.

sample usage

  • https://github.com/tektoncd/pipeline/blob/4a93b625f857ab582e87c17029ee893612ca6cfe/pkg/apis/pipeline/v1beta1/task_validation.go#L158

Shall we consider using them in reconcilers as well. The main advantage is that we will be provide much better context and hierachy to our error messages in both CR status and in logs.

The hierachical context is important for us as we have mechanisms like rbac, prunnig etc as part of reconcilers but with no representation in resource status. It would make our development/debugging workflow more efficient if we could provide a error trail instead of a generic "Prereconcile failed" message.

nikhil-thomas avatar May 22 '22 00:05 nikhil-thomas

Issues go stale after 90d of inactivity. Mark the issue as fresh with /remove-lifecycle stale with a justification. Stale issues rot after an additional 30d of inactivity and eventually close. If this issue is safe to close now please do so with /close with a justification. If this issue should be exempted, mark the issue as frozen with /lifecycle frozen with a justification.

/lifecycle stale

Send feedback to tektoncd/plumbing.

tekton-robot avatar Aug 20 '22 01:08 tekton-robot

Stale issues rot after 30d of inactivity. Mark the issue as fresh with /remove-lifecycle rotten with a justification. Rotten issues close after an additional 30d of inactivity. If this issue is safe to close now please do so with /close with a justification. If this issue should be exempted, mark the issue as frozen with /lifecycle frozen with a justification.

/lifecycle rotten

Send feedback to tektoncd/plumbing.

tekton-robot avatar Sep 19 '22 01:09 tekton-robot

Rotten issues close after 30d of inactivity. Reopen the issue with /reopen with a justification. Mark the issue as fresh with /remove-lifecycle rotten with a justification. If this issue should be exempted, mark the issue as frozen with /lifecycle frozen with a justification.

/close

Send feedback to tektoncd/plumbing.

tekton-robot avatar Oct 19 '22 01:10 tekton-robot

@tekton-robot: Closing this issue.

In response to this:

Rotten issues close after 30d of inactivity. Reopen the issue with /reopen with a justification. Mark the issue as fresh with /remove-lifecycle rotten with a justification. If this issue should be exempted, mark the issue as frozen with /lifecycle frozen with a justification.

/close

Send feedback to tektoncd/plumbing.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

tekton-robot avatar Oct 19 '22 01:10 tekton-robot