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
dab13823
Commit
dab13823
authored
Aug 09, 2017
by
Sean Clemmer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use local JSON log buffer in parseDockerJSONLog.
parent
6a0d3c74
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
5 deletions
+3
-5
kuberuntime_logs.go
pkg/kubelet/kuberuntime/kuberuntime_logs.go
+3
-5
No files found.
pkg/kubelet/kuberuntime/kuberuntime_logs.go
View file @
dab13823
...
@@ -280,16 +280,14 @@ func parseCRILog(log []byte, msg *logMessage) error {
...
@@ -280,16 +280,14 @@ func parseCRILog(log []byte, msg *logMessage) error {
return
nil
return
nil
}
}
// dockerJSONLog is the JSON log buffer used in parseDockerJSONLog.
var
dockerJSONLog
=
&
jsonlog
.
JSONLog
{}
// parseDockerJSONLog parses logs in Docker JSON log format. Docker JSON log format
// parseDockerJSONLog parses logs in Docker JSON log format. Docker JSON log format
// example:
// example:
// {"log":"content 1","stream":"stdout","time":"2016-10-20T18:39:20.57606443Z"}
// {"log":"content 1","stream":"stdout","time":"2016-10-20T18:39:20.57606443Z"}
// {"log":"content 2","stream":"stderr","time":"2016-10-20T18:39:20.57606444Z"}
// {"log":"content 2","stream":"stderr","time":"2016-10-20T18:39:20.57606444Z"}
func
parseDockerJSONLog
(
log
[]
byte
,
msg
*
logMessage
)
error
{
func
parseDockerJSONLog
(
log
[]
byte
,
msg
*
logMessage
)
error
{
dockerJSONLog
.
Reset
()
var
l
=
&
jsonlog
.
JSONLog
{}
l
:=
dockerJSONLog
l
.
Reset
()
// TODO: JSON decoding is fairly expensive, we should evaluate this.
// TODO: JSON decoding is fairly expensive, we should evaluate this.
if
err
:=
json
.
Unmarshal
(
log
,
l
);
err
!=
nil
{
if
err
:=
json
.
Unmarshal
(
log
,
l
);
err
!=
nil
{
return
fmt
.
Errorf
(
"failed with %v to unmarshal log %q"
,
err
,
l
)
return
fmt
.
Errorf
(
"failed with %v to unmarshal log %q"
,
err
,
l
)
...
...
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