-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Port forward ignores errOut for some errors #1303
Comments
The Kubernetes project currently lacks enough contributors to adequately respond to all issues. This bot triages un-triaged issues according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle stale |
The Kubernetes project currently lacks enough active contributors to adequately respond to all issues. This bot triages un-triaged issues according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle rotten |
/remove-lifecycle rotten |
The Kubernetes project currently lacks enough contributors to adequately respond to all issues. This bot triages un-triaged issues according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle stale |
/remove-lifecycle stale |
The Kubernetes project currently lacks enough contributors to adequately respond to all issues. This bot triages un-triaged issues according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle stale |
The Kubernetes project currently lacks enough active contributors to adequately respond to all issues. This bot triages un-triaged issues according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle rotten |
This is a potentially a user error, but it's not obvious to me what I could have done differently. When I create a port forward via
portforward.New()
with appropriate writers forout
anderrOut
there's cases where theerrOut
is ignored.Specifically where I get an error like so:
The first part
an error occurred forwarding
appears to come from hereProblem is I'm actually passing a custom writer to errOut, which should ensure all errors are ran through my structured logger (otherwise I get non-json output in the middle of my structured logs, which screws up the parsing of them).
I did find a hacky workaround after attempting to following the code, which is to call:
before running portforward.
Ideally I wouldn't introduce these packages into my code, but I couldn't see another way to do it.
The above method has the drawback that I have to depend on
klog
,go-logr
andgo-logr/zerologr
in addition to my actual logger, zerolog. Those exist purely to prevent one unstructured error log from appearing.If I've missed a better/cleaner way to do this, I'd love to see an example if possible.
The text was updated successfully, but these errors were encountered: