mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-22 11:21:47 +00:00
Merge pull request #105995 from NoicFank/feature-add-error-handle
Add error handling for Write() function
This commit is contained in:
commit
be9ef536cd
@ -310,7 +310,10 @@ func (eic *execInContainer) Stop() {
|
|||||||
func (eic *execInContainer) Start() error {
|
func (eic *execInContainer) Start() error {
|
||||||
data, err := eic.run()
|
data, err := eic.run()
|
||||||
if eic.writer != nil {
|
if eic.writer != nil {
|
||||||
eic.writer.Write(data)
|
// only record the write error, do not cover the command run error
|
||||||
|
if p, err := eic.writer.Write(data); err != nil {
|
||||||
|
klog.ErrorS(err, "Unable to write all bytes from execInContainer", "expectedBytes", len(data), "actualBytes", p)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user