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
58a9da33
Commit
58a9da33
authored
Sep 07, 2016
by
Pengfei Ni
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Kubelet: rename CreatePodSandbox to RunPodSandbox in CRI
parent
dc529a03
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
21 additions
and
20 deletions
+21
-20
services.go
pkg/kubelet/api/services.go
+3
-3
fake_runtime_service.go
pkg/kubelet/api/testing/fake_runtime_service.go
+2
-2
api.pb.go
pkg/kubelet/api/v1alpha1/runtime/api.pb.go
+0
-0
api.proto
pkg/kubelet/api/v1alpha1/runtime/api.proto
+5
-5
docker_sandbox.go
pkg/kubelet/dockershim/docker_sandbox.go
+3
-3
docker_sandbox_test.go
pkg/kubelet/dockershim/docker_sandbox_test.go
+1
-1
remote_runtime.go
pkg/kubelet/remote/remote_runtime.go
+5
-4
pod-level-interface.go
pkg/kubelet/rktshim/pod-level-interface.go
+2
-2
No files found.
pkg/kubelet/api/services.go
View file @
58a9da33
...
...
@@ -50,9 +50,9 @@ type ContainerManager interface {
// PodSandboxManager contains methods for operating on PodSandboxes. The methods
// are thread-safe.
type
PodSandboxManager
interface
{
//
CreatePodSandbox creates a pod-level sandbox.
//
The definition of PodSandbox is at https://github.com/kubernetes/kubernetes/pull/25899
Create
PodSandbox
(
config
*
runtimeApi
.
PodSandboxConfig
)
(
string
,
error
)
//
RunPodSandbox creates and starts a pod-level sandbox. Runtimes should ensure
//
the sandbox is in ready state.
Run
PodSandbox
(
config
*
runtimeApi
.
PodSandboxConfig
)
(
string
,
error
)
// StopPodSandbox stops the sandbox. If there are any running containers in the
// sandbox, they should be force terminated.
StopPodSandbox
(
podSandboxID
string
)
error
...
...
pkg/kubelet/api/testing/fake_runtime_service.go
View file @
58a9da33
...
...
@@ -99,11 +99,11 @@ func (r *FakeRuntimeService) Version(apiVersion string) (*runtimeApi.VersionResp
},
nil
}
func
(
r
*
FakeRuntimeService
)
Create
PodSandbox
(
config
*
runtimeApi
.
PodSandboxConfig
)
(
string
,
error
)
{
func
(
r
*
FakeRuntimeService
)
Run
PodSandbox
(
config
*
runtimeApi
.
PodSandboxConfig
)
(
string
,
error
)
{
r
.
Lock
()
defer
r
.
Unlock
()
r
.
Called
=
append
(
r
.
Called
,
"
Create
PodSandbox"
)
r
.
Called
=
append
(
r
.
Called
,
"
Run
PodSandbox"
)
// PodSandboxID should be randomized for real container runtime, but here just use
// fixed name from BuildSandboxName() for easily making fake sandboxes.
...
...
pkg/kubelet/api/v1alpha1/runtime/api.pb.go
View file @
58a9da33
This diff is collapsed.
Click to expand it.
pkg/kubelet/api/v1alpha1/runtime/api.proto
View file @
58a9da33
...
...
@@ -8,9 +8,9 @@ service RuntimeService {
// Version returns the runtime name, runtime version and runtime API version
rpc
Version
(
VersionRequest
)
returns
(
VersionResponse
)
{}
//
CreatePodSandbox creates a pod-level sandbox.
//
The definition of PodSandbox is at https://github.com/kubernetes/kubernetes/pull/25899
rpc
CreatePodSandbox
(
CreatePodSandboxRequest
)
returns
(
Create
PodSandboxResponse
)
{}
//
RunPodSandbox creates and starts a pod-level sandbox. Runtimes should ensure
//
the sandbox is in ready state.
rpc
RunPodSandbox
(
RunPodSandboxRequest
)
returns
(
Run
PodSandboxResponse
)
{}
// StopPodSandbox stops the running sandbox. If there are any running
// containers in the sandbox, they should be forcibly terminated.
rpc
StopPodSandbox
(
StopPodSandboxRequest
)
returns
(
StopPodSandboxResponse
)
{}
...
...
@@ -188,12 +188,12 @@ message PodSandboxConfig {
optional
LinuxPodSandboxConfig
linux
=
8
;
}
message
Create
PodSandboxRequest
{
message
Run
PodSandboxRequest
{
// The configuration for creating a PodSandBox.
optional
PodSandboxConfig
config
=
1
;
}
message
Create
PodSandboxResponse
{
message
Run
PodSandboxResponse
{
// The id of the PodSandBox
optional
string
pod_sandbox_id
=
1
;
}
...
...
pkg/kubelet/dockershim/docker_sandbox.go
View file @
58a9da33
...
...
@@ -37,12 +37,12 @@ const (
defaultSandboxGracePeriod
int
=
10
)
//
CreatePodSandbox creates a pod-level sandbox.
//
The definition of PodSandbox is at https://github.com/kubernetes/kubernetes/pull/25899
//
RunPodSandbox creates and starts a pod-level sandbox. Runtimes should ensure
//
the sandbox is in ready state.
// For docker, PodSandbox is implemented by a container holding the network
// namespace for the pod.
// Note: docker doesn't use LogDirectory (yet).
func
(
ds
*
dockerService
)
Create
PodSandbox
(
config
*
runtimeApi
.
PodSandboxConfig
)
(
string
,
error
)
{
func
(
ds
*
dockerService
)
Run
PodSandbox
(
config
*
runtimeApi
.
PodSandboxConfig
)
(
string
,
error
)
{
// Step 1: Pull the image for the sandbox.
// TODO: How should we handle pulling custom pod infra container image
// (with credentials)?
...
...
pkg/kubelet/dockershim/docker_sandbox_test.go
View file @
58a9da33
...
...
@@ -36,7 +36,7 @@ func TestCreateSandbox(t *testing.T) {
Uid
:
&
uid
,
},
}
id
,
err
:=
ds
.
Create
PodSandbox
(
config
)
id
,
err
:=
ds
.
Run
PodSandbox
(
config
)
if
err
!=
nil
{
t
.
Errorf
(
"Unexpected error: %v"
,
err
)
}
...
...
pkg/kubelet/remote/remote_runtime.go
View file @
58a9da33
...
...
@@ -64,16 +64,17 @@ func (r *RemoteRuntimeService) Version(apiVersion string) (*runtimeApi.VersionRe
return
typedVersion
,
err
}
// CreatePodSandbox creates a pod-level sandbox.
func
(
r
*
RemoteRuntimeService
)
CreatePodSandbox
(
config
*
runtimeApi
.
PodSandboxConfig
)
(
string
,
error
)
{
// RunPodSandbox creates and starts a pod-level sandbox. Runtimes should ensure
// the sandbox is in ready state.
func
(
r
*
RemoteRuntimeService
)
RunPodSandbox
(
config
*
runtimeApi
.
PodSandboxConfig
)
(
string
,
error
)
{
ctx
,
cancel
:=
getContextWithTimeout
(
r
.
timeout
)
defer
cancel
()
resp
,
err
:=
r
.
runtimeClient
.
CreatePodSandbox
(
ctx
,
&
runtimeApi
.
Create
PodSandboxRequest
{
resp
,
err
:=
r
.
runtimeClient
.
RunPodSandbox
(
ctx
,
&
runtimeApi
.
Run
PodSandboxRequest
{
Config
:
config
,
})
if
err
!=
nil
{
glog
.
Errorf
(
"
Create
PodSandbox from runtime service failed: %v"
,
err
)
glog
.
Errorf
(
"
Run
PodSandbox from runtime service failed: %v"
,
err
)
return
""
,
err
}
...
...
pkg/kubelet/rktshim/pod-level-interface.go
View file @
58a9da33
...
...
@@ -33,8 +33,8 @@ func NewPodSandboxManager(PodSandboxManagerConfig) (kubeletApi.PodSandboxManager
return
&
PodSandboxManager
{},
nil
}
//
CreatePodSandbox create
s a pod sandbox given a pod sandbox configuration.
func
(
*
PodSandboxManager
)
Create
PodSandbox
(
*
runtimeApi
.
PodSandboxConfig
)
(
string
,
error
)
{
//
RunPodSandbox creates and start
s a pod sandbox given a pod sandbox configuration.
func
(
*
PodSandboxManager
)
Run
PodSandbox
(
*
runtimeApi
.
PodSandboxConfig
)
(
string
,
error
)
{
panic
(
"not implemented"
)
}
...
...
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