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
dfadc10f
Commit
dfadc10f
authored
Apr 29, 2015
by
Victor Marmol
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #7488 from yifan-gu/get_container_logs
kubelet/container: Add GetContainerLogs to runtime interface.
parents
38831237
fb1c55aa
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
5 deletions
+10
-5
runtime.go
pkg/kubelet/container/runtime.go
+5
-0
manager.go
pkg/kubelet/dockertools/manager.go
+4
-4
kubelet.go
pkg/kubelet/kubelet.go
+1
-1
No files found.
pkg/kubelet/container/runtime.go
View file @
dfadc10f
...
...
@@ -74,6 +74,11 @@ type Runtime interface {
PullImage
(
image
string
)
error
// IsImagePresent checks whether the container image is already in the local storage.
IsImagePresent
(
image
string
)
(
bool
,
error
)
// GetContainerLogs returns logs of a specific container. By
// default, it returns a snapshot of the container log. Set 'follow' to true to
// stream the log. Set 'follow' to false and specify the number of lines (e.g.
// "100" or "all") to tail the log.
GetContainerLogs
(
containerID
,
tail
string
,
follow
bool
,
stdout
,
stderr
io
.
Writer
)
(
err
error
)
}
// Pod is a group of containers, with the status of the pod.
...
...
pkg/kubelet/dockertools/manager.go
View file @
dfadc10f
...
...
@@ -171,12 +171,12 @@ func (sc *stringCache) Get(uid types.UID, name string) (string, bool) {
}
}
// Get
KubeletDocker
ContainerLogs returns logs of a specific container. By
// default, it returns a snapshot of the container log. Set
|follow|
to true to
// stream the log. Set
|follow|
to false and specify the number of lines (e.g.
// GetContainerLogs returns logs of a specific container. By
// default, it returns a snapshot of the container log. Set
'follow'
to true to
// stream the log. Set
'follow'
to false and specify the number of lines (e.g.
// "100" or "all") to tail the log.
// TODO: Make 'RawTerminal' option flagable.
func
(
dm
*
DockerManager
)
Get
KubeletDocker
ContainerLogs
(
containerID
,
tail
string
,
follow
bool
,
stdout
,
stderr
io
.
Writer
)
(
err
error
)
{
func
(
dm
*
DockerManager
)
GetContainerLogs
(
containerID
,
tail
string
,
follow
bool
,
stdout
,
stderr
io
.
Writer
)
(
err
error
)
{
opts
:=
docker
.
LogsOptions
{
Container
:
containerID
,
Stdout
:
true
,
...
...
pkg/kubelet/kubelet.go
View file @
dfadc10f
...
...
@@ -1655,7 +1655,7 @@ func (kl *Kubelet) GetKubeletContainerLogs(podFullName, containerName, tail stri
// waiting state.
return
err
}
return
kl
.
containerManager
.
Get
KubeletDocker
ContainerLogs
(
dockerContainerID
,
tail
,
follow
,
stdout
,
stderr
)
return
kl
.
containerManager
.
GetContainerLogs
(
dockerContainerID
,
tail
,
follow
,
stdout
,
stderr
)
}
// GetHostname Returns the hostname as the kubelet sees it.
...
...
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