-
Notifications
You must be signed in to change notification settings - Fork 331
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
apis.errs.Also does not propagate error level #2514
Comments
Thanks for opening this 🙏 cc @dprotaso @evankanderson @vaikas @n3wscott To reiterate some of the thread in Tekton, this is sort of a reflection of the awkward conflation of In your example, What do folks think? |
@mattmoor you have a link to Tekton thread handy since it seems to have more context? |
I'd expect the "lowest" level when aggregating via Given that this code is unlikely to be in a tight loop, I wonder if looping over the set of contained errors to determine the correct collection-level would be correct. You could early-exit the loop if
The worst case performance would be constructing a long chain of |
This issue is stale because it has been open for 90 days with no |
/lifecycle frozen |
Thanks @evankanderson for the table of the combinations of errs incurred. I would like to confirm my understanding on the O(n) solution, would that need to introduce a hash-table in a (possible cyclic?) graph? |
You shouldn't need a hash table for caching, as you only need to track the "head" of the chain as long as the cache is correct. Using If you want, you could use the go benchmark library to compare approaches if you want to learn that... |
/area API
/kind bug
Steps to Reproduce the Problem
Using "warning" level error introduced in #2498:
Expected Behavior
The aggregated error has the level that is the highest level of any errors combined with
Also
.In the example above, I would expect
errs.Level
to be Warning, anderrs.Filter(apis.WarningLevel).Level
to also be Warning.Actual Behavior
In the example above,
errs.Level
anderrs.Filter(apis.WarningLevel).Level
are both Error. (i.e. an error at level "warning" aggregated with no error turns into an error at level "error")@mattmoor
The text was updated successfully, but these errors were encountered: