Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
65190e2a
Commit
65190e2a
authored
Feb 07, 2017
by
Random-Liu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Let ReadLogs return when there is a read error.
parent
3ce49346
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
0 deletions
+8
-0
kuberuntime_logs.go
pkg/kubelet/kuberuntime/kuberuntime_logs.go
+8
-0
No files found.
pkg/kubelet/kuberuntime/kuberuntime_logs.go
View file @
65190e2a
...
...
@@ -191,6 +191,7 @@ func ReadLogs(path string, apiOpts *v1.PodLogOptions, stdout, stderr io.Writer)
return
nil
}
glog
.
Errorf
(
"Failed with err %v when writing log for log file %q: %+v"
,
err
,
path
,
msg
)
return
err
}
}
}
...
...
@@ -299,6 +300,9 @@ type logWriter struct {
// errMaximumWrite is returned when all bytes have been written.
var
errMaximumWrite
=
errors
.
New
(
"maximum write"
)
// errShortWrite is returned when the message is not fully written.
var
errShortWrite
=
errors
.
New
(
"short write"
)
func
newLogWriter
(
stdout
io
.
Writer
,
stderr
io
.
Writer
,
opts
*
logOptions
)
*
logWriter
{
w
:=
&
logWriter
{
stdout
:
stdout
,
...
...
@@ -342,6 +346,10 @@ func (w *logWriter) write(msg *logMessage) error {
if
err
!=
nil
{
return
err
}
// If the line has not been fully written, return errShortWrite
if
n
<
len
(
line
)
{
return
errShortWrite
}
// If there are no more bytes left, return errMaximumWrite
if
w
.
remain
<=
0
{
return
errMaximumWrite
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment