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
fb1c55aa
Commit
fb1c55aa
authored
Apr 28, 2015
by
Yifan Gu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kubelet/container: Add GetContainerLogs to runtime interface.
parent
a4316aa6
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 @
fb1c55aa
...
@@ -72,6 +72,11 @@ type Runtime interface {
...
@@ -72,6 +72,11 @@ type Runtime interface {
Pull
(
image
string
)
Pull
(
image
string
)
// IsImagePresent checks whether the container image is already in the local storage.
// IsImagePresent checks whether the container image is already in the local storage.
IsImagePresent
(
image
string
)
(
bool
,
error
)
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.
// Pod is a group of containers, with the status of the pod.
...
...
pkg/kubelet/dockertools/manager.go
View file @
fb1c55aa
...
@@ -171,12 +171,12 @@ func (sc *stringCache) Get(uid types.UID, name string) (string, bool) {
...
@@ -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
// GetContainerLogs returns logs of a specific container. By
// default, it returns a snapshot of the container log. Set
|follow|
to true to
// 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.
// stream the log. Set
'follow'
to false and specify the number of lines (e.g.
// "100" or "all") to tail the log.
// "100" or "all") to tail the log.
// TODO: Make 'RawTerminal' option flagable.
// 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
{
opts
:=
docker
.
LogsOptions
{
Container
:
containerID
,
Container
:
containerID
,
Stdout
:
true
,
Stdout
:
true
,
...
...
pkg/kubelet/kubelet.go
View file @
fb1c55aa
...
@@ -1655,7 +1655,7 @@ func (kl *Kubelet) GetKubeletContainerLogs(podFullName, containerName, tail stri
...
@@ -1655,7 +1655,7 @@ func (kl *Kubelet) GetKubeletContainerLogs(podFullName, containerName, tail stri
// waiting state.
// waiting state.
return
err
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.
// 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