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
4b79e5a3
Commit
4b79e5a3
authored
Apr 27, 2015
by
Dawn Chen
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #7403 from vmarmol/rkt-deps
Remove DockerPrefix references in Kubelet.
parents
0c611370
42a2059a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
3 deletions
+15
-3
helpers.go
pkg/kubelet/container/helpers.go
+13
-0
kubelet.go
pkg/kubelet/kubelet.go
+2
-3
No files found.
pkg/kubelet/container/helpers.go
View file @
4b79e5a3
...
@@ -17,6 +17,8 @@ limitations under the License.
...
@@ -17,6 +17,8 @@ limitations under the License.
package
container
package
container
import
(
import
(
"strings"
"github.com/GoogleCloudPlatform/kubernetes/pkg/api"
"github.com/GoogleCloudPlatform/kubernetes/pkg/api"
"github.com/GoogleCloudPlatform/kubernetes/pkg/probe"
"github.com/GoogleCloudPlatform/kubernetes/pkg/probe"
)
)
...
@@ -37,3 +39,14 @@ type Prober interface {
...
@@ -37,3 +39,14 @@ type Prober interface {
type
RunContainerOptionsGenerator
interface
{
type
RunContainerOptionsGenerator
interface
{
GenerateRunContainerOptions
(
pod
*
api
.
Pod
,
container
*
api
.
Container
,
netMode
,
ipcMode
string
)
(
*
RunContainerOptions
,
error
)
GenerateRunContainerOptions
(
pod
*
api
.
Pod
,
container
*
api
.
Container
,
netMode
,
ipcMode
string
)
(
*
RunContainerOptions
,
error
)
}
}
// Trims runtime prefix from image name (e.g.: docker://busybox -> busybox).
func
TrimRuntimePrefixFromImage
(
img
string
)
string
{
const
prefixSeparator
=
"://"
idx
:=
strings
.
Index
(
img
,
prefixSeparator
)
if
idx
<
0
{
return
img
}
return
img
[
idx
+
len
(
prefixSeparator
)
:
]
}
pkg/kubelet/kubelet.go
View file @
4b79e5a3
...
@@ -934,8 +934,7 @@ func shouldContainerBeRestarted(container *api.Container, pod *api.Pod, podStatu
...
@@ -934,8 +934,7 @@ func shouldContainerBeRestarted(container *api.Container, pod *api.Pod, podStatu
// Set dead containers to unready state.
// Set dead containers to unready state.
for
_
,
c
:=
range
resultStatus
{
for
_
,
c
:=
range
resultStatus
{
// TODO(yifan): Unify the format of container ID. (i.e. including docker:// as prefix).
readinessManager
.
RemoveReadiness
(
kubecontainer
.
TrimRuntimePrefixFromImage
(
c
.
ContainerID
))
readinessManager
.
RemoveReadiness
(
strings
.
TrimPrefix
(
c
.
ContainerID
,
dockertools
.
DockerPrefix
))
}
}
// Check RestartPolicy for dead container.
// Check RestartPolicy for dead container.
...
@@ -1653,7 +1652,7 @@ func (kl *Kubelet) validateContainerStatus(podStatus *api.PodStatus, containerNa
...
@@ -1653,7 +1652,7 @@ func (kl *Kubelet) validateContainerStatus(podStatus *api.PodStatus, containerNa
if
cStatus
.
State
.
Waiting
!=
nil
{
if
cStatus
.
State
.
Waiting
!=
nil
{
return
""
,
fmt
.
Errorf
(
"container %q is in waiting state."
,
containerName
)
return
""
,
fmt
.
Errorf
(
"container %q is in waiting state."
,
containerName
)
}
}
return
strings
.
Replace
(
cStatus
.
ContainerID
,
dockertools
.
DockerPrefix
,
""
,
1
),
nil
return
kubecontainer
.
TrimRuntimePrefixFromImage
(
cStatus
.
ContainerID
),
nil
}
}
// GetKubeletContainerLogs returns logs from the container
// GetKubeletContainerLogs returns logs from the container
...
...
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