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
9da9e2ab
Commit
9da9e2ab
authored
Aug 11, 2017
by
Pengfei Ni
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Create container log symlink for all containers
parent
7adb6750
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
7 deletions
+10
-7
docker_container.go
pkg/kubelet/dockershim/docker_container.go
+10
-7
No files found.
pkg/kubelet/dockershim/docker_container.go
View file @
9da9e2ab
...
@@ -236,18 +236,21 @@ func (ds *dockerService) removeContainerLogSymlink(containerID string) error {
...
@@ -236,18 +236,21 @@ func (ds *dockerService) removeContainerLogSymlink(containerID string) error {
// StartContainer starts the container.
// StartContainer starts the container.
func
(
ds
*
dockerService
)
StartContainer
(
containerID
string
)
error
{
func
(
ds
*
dockerService
)
StartContainer
(
containerID
string
)
error
{
err
:=
ds
.
client
.
StartContainer
(
containerID
)
err
:=
ds
.
client
.
StartContainer
(
containerID
)
if
err
!=
nil
{
err
=
transformStartContainerError
(
err
)
// Create container log symlink for all containers (including failed ones).
return
fmt
.
Errorf
(
"failed to start container %q: %v"
,
containerID
,
err
)
if
linkError
:=
ds
.
createContainerLogSymlink
(
containerID
);
linkError
!=
nil
{
}
// Create container log symlink.
if
err
:=
ds
.
createContainerLogSymlink
(
containerID
);
err
!=
nil
{
// Do not stop the container if we failed to create symlink because:
// Do not stop the container if we failed to create symlink because:
// 1. This is not a critical failure.
// 1. This is not a critical failure.
// 2. We don't have enough information to properly stop container here.
// 2. We don't have enough information to properly stop container here.
// Kubelet will surface this error to user via an event.
// Kubelet will surface this error to user via an event.
return
er
r
return
linkErro
r
}
}
if
err
!=
nil
{
err
=
transformStartContainerError
(
err
)
return
fmt
.
Errorf
(
"failed to start container %q: %v"
,
containerID
,
err
)
}
return
nil
return
nil
}
}
...
...
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