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
5c06d7e6
Commit
5c06d7e6
authored
Aug 03, 2016
by
Yu-Ju Hong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
CRI: rename DeletePodSandbox to RemovePodSandbox
This makes it consistent with other calls (e.g., RemoveContainer, RemoveImage).
parent
7c326672
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
66 additions
and
66 deletions
+66
-66
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
+39
-39
api.proto
pkg/kubelet/api/v1alpha1/runtime/api.proto
+14
-14
docker_sandbox.go
pkg/kubelet/dockershim/docker_sandbox.go
+3
-3
remote_runtime.go
pkg/kubelet/remote/remote_runtime.go
+5
-5
No files found.
pkg/kubelet/api/services.go
View file @
5c06d7e6
...
...
@@ -33,9 +33,9 @@ type RuntimeService interface {
// StopPodSandbox stops the sandbox. If there are any running containers in the
// sandbox, they should be force terminated.
StopPodSandbox
(
podSandboxID
string
)
error
//
DeletePodSandbox delet
es the sandbox. If there are running containers in the
// sandbox, they should be forcibly
delet
ed.
Delet
ePodSandbox
(
podSandboxID
string
)
error
//
RemovePodSandbox remov
es the sandbox. If there are running containers in the
// sandbox, they should be forcibly
remov
ed.
Remov
ePodSandbox
(
podSandboxID
string
)
error
// PodSandboxStatus returns the Status of the PodSandbox.
PodSandboxStatus
(
podSandboxID
string
)
(
*
runtimeApi
.
PodSandboxStatus
,
error
)
// ListPodSandbox returns a list of Sandbox.
...
...
pkg/kubelet/api/testing/fake_runtime_service.go
View file @
5c06d7e6
...
...
@@ -144,11 +144,11 @@ func (r *FakeRuntimeService) StopPodSandbox(podSandboxID string) error {
return
nil
}
func
(
r
*
FakeRuntimeService
)
Delet
ePodSandbox
(
podSandboxID
string
)
error
{
func
(
r
*
FakeRuntimeService
)
Remov
ePodSandbox
(
podSandboxID
string
)
error
{
r
.
Lock
()
defer
r
.
Unlock
()
r
.
Called
=
append
(
r
.
Called
,
"
Delet
ePodSandbox"
)
r
.
Called
=
append
(
r
.
Called
,
"
Remov
ePodSandbox"
)
// Remove the pod sandbox
delete
(
r
.
Sandboxes
,
podSandboxID
)
...
...
pkg/kubelet/api/v1alpha1/runtime/api.pb.go
View file @
5c06d7e6
...
...
@@ -39,8 +39,8 @@ It has these top-level messages:
CreatePodSandboxResponse
StopPodSandboxRequest
StopPodSandboxResponse
Delet
ePodSandboxRequest
Delet
ePodSandboxResponse
Remov
ePodSandboxRequest
Remov
ePodSandboxResponse
PodSandboxStatusRequest
PodSandboxNetworkStatus
Namespace
...
...
@@ -700,30 +700,30 @@ func (m *StopPodSandboxResponse) Reset() { *m = StopPodSandboxResponse{}
func
(
m
*
StopPodSandboxResponse
)
String
()
string
{
return
proto
.
CompactTextString
(
m
)
}
func
(
*
StopPodSandboxResponse
)
ProtoMessage
()
{}
type
Delet
ePodSandboxRequest
struct
{
type
Remov
ePodSandboxRequest
struct
{
// The id of the PodSandBox
PodSandboxId
*
string
`protobuf:"bytes,1,opt,name=pod_sandbox_id" json:"pod_sandbox_id,omitempty"`
XXX_unrecognized
[]
byte
`json:"-"`
}
func
(
m
*
DeletePodSandboxRequest
)
Reset
()
{
*
m
=
Delet
ePodSandboxRequest
{}
}
func
(
m
*
Delet
ePodSandboxRequest
)
String
()
string
{
return
proto
.
CompactTextString
(
m
)
}
func
(
*
Delet
ePodSandboxRequest
)
ProtoMessage
()
{}
func
(
m
*
RemovePodSandboxRequest
)
Reset
()
{
*
m
=
Remov
ePodSandboxRequest
{}
}
func
(
m
*
Remov
ePodSandboxRequest
)
String
()
string
{
return
proto
.
CompactTextString
(
m
)
}
func
(
*
Remov
ePodSandboxRequest
)
ProtoMessage
()
{}
func
(
m
*
Delet
ePodSandboxRequest
)
GetPodSandboxId
()
string
{
func
(
m
*
Remov
ePodSandboxRequest
)
GetPodSandboxId
()
string
{
if
m
!=
nil
&&
m
.
PodSandboxId
!=
nil
{
return
*
m
.
PodSandboxId
}
return
""
}
type
Delet
ePodSandboxResponse
struct
{
type
Remov
ePodSandboxResponse
struct
{
XXX_unrecognized
[]
byte
`json:"-"`
}
func
(
m
*
DeletePodSandboxResponse
)
Reset
()
{
*
m
=
Delet
ePodSandboxResponse
{}
}
func
(
m
*
Delet
ePodSandboxResponse
)
String
()
string
{
return
proto
.
CompactTextString
(
m
)
}
func
(
*
Delet
ePodSandboxResponse
)
ProtoMessage
()
{}
func
(
m
*
RemovePodSandboxResponse
)
Reset
()
{
*
m
=
Remov
ePodSandboxResponse
{}
}
func
(
m
*
Remov
ePodSandboxResponse
)
String
()
string
{
return
proto
.
CompactTextString
(
m
)
}
func
(
*
Remov
ePodSandboxResponse
)
ProtoMessage
()
{}
type
PodSandboxStatusRequest
struct
{
// The id of the PodSandBox
...
...
@@ -2255,8 +2255,8 @@ func init() {
proto
.
RegisterType
((
*
CreatePodSandboxResponse
)(
nil
),
"runtime.CreatePodSandboxResponse"
)
proto
.
RegisterType
((
*
StopPodSandboxRequest
)(
nil
),
"runtime.StopPodSandboxRequest"
)
proto
.
RegisterType
((
*
StopPodSandboxResponse
)(
nil
),
"runtime.StopPodSandboxResponse"
)
proto
.
RegisterType
((
*
DeletePodSandboxRequest
)(
nil
),
"runtime.Delet
ePodSandboxRequest"
)
proto
.
RegisterType
((
*
DeletePodSandboxResponse
)(
nil
),
"runtime.Delet
ePodSandboxResponse"
)
proto
.
RegisterType
((
*
RemovePodSandboxRequest
)(
nil
),
"runtime.Remov
ePodSandboxRequest"
)
proto
.
RegisterType
((
*
RemovePodSandboxResponse
)(
nil
),
"runtime.Remov
ePodSandboxResponse"
)
proto
.
RegisterType
((
*
PodSandboxStatusRequest
)(
nil
),
"runtime.PodSandboxStatusRequest"
)
proto
.
RegisterType
((
*
PodSandboxNetworkStatus
)(
nil
),
"runtime.PodSandboxNetworkStatus"
)
proto
.
RegisterType
((
*
Namespace
)(
nil
),
"runtime.Namespace"
)
...
...
@@ -2320,14 +2320,14 @@ type RuntimeServiceClient interface {
// CreatePodSandbox creates a pod-level sandbox.
// The definition of PodSandbox is at https://github.com/kubernetes/kubernetes/pull/25899
CreatePodSandbox
(
ctx
context
.
Context
,
in
*
CreatePodSandboxRequest
,
opts
...
grpc
.
CallOption
)
(
*
CreatePodSandboxResponse
,
error
)
// StopPodSandbox stops the
sandbox. If there are any running containers in the
//
sandbox, they should be force
terminated.
// StopPodSandbox stops the
running sandbox. If there are any running
//
containers in the sandbox, they should be forcibly
terminated.
StopPodSandbox
(
ctx
context
.
Context
,
in
*
StopPodSandboxRequest
,
opts
...
grpc
.
CallOption
)
(
*
StopPodSandboxResponse
,
error
)
//
DeletePodSandbox delet
es the sandbox. If there are any running containers in the
// sandbox, they should be forc
e delet
ed.
// It should return success if the sandbox has already been
delet
ed.
DeletePodSandbox
(
ctx
context
.
Context
,
in
*
DeletePodSandboxRequest
,
opts
...
grpc
.
CallOption
)
(
*
Delet
ePodSandboxResponse
,
error
)
// PodSandboxStatus returns the
S
tatus of the PodSandbox.
//
RemovePodSandbox remov
es the sandbox. If there are any running containers in the
// sandbox, they should be forc
ibly remov
ed.
// It should return success if the sandbox has already been
remov
ed.
RemovePodSandbox
(
ctx
context
.
Context
,
in
*
RemovePodSandboxRequest
,
opts
...
grpc
.
CallOption
)
(
*
Remov
ePodSandboxResponse
,
error
)
// PodSandboxStatus returns the
s
tatus of the PodSandbox.
PodSandboxStatus
(
ctx
context
.
Context
,
in
*
PodSandboxStatusRequest
,
opts
...
grpc
.
CallOption
)
(
*
PodSandboxStatusResponse
,
error
)
// ListPodSandbox returns a list of SandBox.
ListPodSandbox
(
ctx
context
.
Context
,
in
*
ListPodSandboxRequest
,
opts
...
grpc
.
CallOption
)
(
*
ListPodSandboxResponse
,
error
)
...
...
@@ -2337,8 +2337,8 @@ type RuntimeServiceClient interface {
StartContainer
(
ctx
context
.
Context
,
in
*
StartContainerRequest
,
opts
...
grpc
.
CallOption
)
(
*
StartContainerResponse
,
error
)
// StopContainer stops a running container with a grace period (i.e., timeout).
StopContainer
(
ctx
context
.
Context
,
in
*
StopContainerRequest
,
opts
...
grpc
.
CallOption
)
(
*
StopContainerResponse
,
error
)
// RemoveContainer removes the container. If the container is running, the
container
//
should be force
removed.
// RemoveContainer removes the container. If the container is running, the
//
container should be forcibly
removed.
// It should return success if the container has already been removed.
RemoveContainer
(
ctx
context
.
Context
,
in
*
RemoveContainerRequest
,
opts
...
grpc
.
CallOption
)
(
*
RemoveContainerResponse
,
error
)
// ListContainers lists all containers by filters.
...
...
@@ -2384,9 +2384,9 @@ func (c *runtimeServiceClient) StopPodSandbox(ctx context.Context, in *StopPodSa
return
out
,
nil
}
func
(
c
*
runtimeServiceClient
)
DeletePodSandbox
(
ctx
context
.
Context
,
in
*
DeletePodSandboxRequest
,
opts
...
grpc
.
CallOption
)
(
*
Delet
ePodSandboxResponse
,
error
)
{
out
:=
new
(
Delet
ePodSandboxResponse
)
err
:=
grpc
.
Invoke
(
ctx
,
"/runtime.RuntimeService/
Delet
ePodSandbox"
,
in
,
out
,
c
.
cc
,
opts
...
)
func
(
c
*
runtimeServiceClient
)
RemovePodSandbox
(
ctx
context
.
Context
,
in
*
RemovePodSandboxRequest
,
opts
...
grpc
.
CallOption
)
(
*
Remov
ePodSandboxResponse
,
error
)
{
out
:=
new
(
Remov
ePodSandboxResponse
)
err
:=
grpc
.
Invoke
(
ctx
,
"/runtime.RuntimeService/
Remov
ePodSandbox"
,
in
,
out
,
c
.
cc
,
opts
...
)
if
err
!=
nil
{
return
nil
,
err
}
...
...
@@ -2504,14 +2504,14 @@ type RuntimeServiceServer interface {
// CreatePodSandbox creates a pod-level sandbox.
// The definition of PodSandbox is at https://github.com/kubernetes/kubernetes/pull/25899
CreatePodSandbox
(
context
.
Context
,
*
CreatePodSandboxRequest
)
(
*
CreatePodSandboxResponse
,
error
)
// StopPodSandbox stops the
sandbox. If there are any running containers in the
//
sandbox, they should be force
terminated.
// StopPodSandbox stops the
running sandbox. If there are any running
//
containers in the sandbox, they should be forcibly
terminated.
StopPodSandbox
(
context
.
Context
,
*
StopPodSandboxRequest
)
(
*
StopPodSandboxResponse
,
error
)
//
DeletePodSandbox delet
es the sandbox. If there are any running containers in the
// sandbox, they should be forc
e delet
ed.
// It should return success if the sandbox has already been
delet
ed.
DeletePodSandbox
(
context
.
Context
,
*
DeletePodSandboxRequest
)
(
*
Delet
ePodSandboxResponse
,
error
)
// PodSandboxStatus returns the
S
tatus of the PodSandbox.
//
RemovePodSandbox remov
es the sandbox. If there are any running containers in the
// sandbox, they should be forc
ibly remov
ed.
// It should return success if the sandbox has already been
remov
ed.
RemovePodSandbox
(
context
.
Context
,
*
RemovePodSandboxRequest
)
(
*
Remov
ePodSandboxResponse
,
error
)
// PodSandboxStatus returns the
s
tatus of the PodSandbox.
PodSandboxStatus
(
context
.
Context
,
*
PodSandboxStatusRequest
)
(
*
PodSandboxStatusResponse
,
error
)
// ListPodSandbox returns a list of SandBox.
ListPodSandbox
(
context
.
Context
,
*
ListPodSandboxRequest
)
(
*
ListPodSandboxResponse
,
error
)
...
...
@@ -2521,8 +2521,8 @@ type RuntimeServiceServer interface {
StartContainer
(
context
.
Context
,
*
StartContainerRequest
)
(
*
StartContainerResponse
,
error
)
// StopContainer stops a running container with a grace period (i.e., timeout).
StopContainer
(
context
.
Context
,
*
StopContainerRequest
)
(
*
StopContainerResponse
,
error
)
// RemoveContainer removes the container. If the container is running, the
container
//
should be force
removed.
// RemoveContainer removes the container. If the container is running, the
//
container should be forcibly
removed.
// It should return success if the container has already been removed.
RemoveContainer
(
context
.
Context
,
*
RemoveContainerRequest
)
(
*
RemoveContainerResponse
,
error
)
// ListContainers lists all containers by filters.
...
...
@@ -2573,12 +2573,12 @@ func _RuntimeService_StopPodSandbox_Handler(srv interface{}, ctx context.Context
return
out
,
nil
}
func
_RuntimeService_
Delet
ePodSandbox_Handler
(
srv
interface
{},
ctx
context
.
Context
,
dec
func
(
interface
{})
error
)
(
interface
{},
error
)
{
in
:=
new
(
Delet
ePodSandboxRequest
)
func
_RuntimeService_
Remov
ePodSandbox_Handler
(
srv
interface
{},
ctx
context
.
Context
,
dec
func
(
interface
{})
error
)
(
interface
{},
error
)
{
in
:=
new
(
Remov
ePodSandboxRequest
)
if
err
:=
dec
(
in
);
err
!=
nil
{
return
nil
,
err
}
out
,
err
:=
srv
.
(
RuntimeServiceServer
)
.
Delet
ePodSandbox
(
ctx
,
in
)
out
,
err
:=
srv
.
(
RuntimeServiceServer
)
.
Remov
ePodSandbox
(
ctx
,
in
)
if
err
!=
nil
{
return
nil
,
err
}
...
...
@@ -2724,8 +2724,8 @@ var _RuntimeService_serviceDesc = grpc.ServiceDesc{
Handler
:
_RuntimeService_StopPodSandbox_Handler
,
},
{
MethodName
:
"
Delet
ePodSandbox"
,
Handler
:
_RuntimeService_
Delet
ePodSandbox_Handler
,
MethodName
:
"
Remov
ePodSandbox"
,
Handler
:
_RuntimeService_
Remov
ePodSandbox_Handler
,
},
{
MethodName
:
"PodSandboxStatus"
,
...
...
pkg/kubelet/api/v1alpha1/runtime/api.proto
View file @
5c06d7e6
//
api.pb.go could be generate by hack/update-generate
-runtime.sh
//
To regenerate api.pb.go run hack/update-generated
-runtime.sh
syntax
=
'proto2'
;
package
runtime
;
...
...
@@ -11,14 +11,14 @@ service RuntimeService {
// CreatePodSandbox creates a pod-level sandbox.
// The definition of PodSandbox is at https://github.com/kubernetes/kubernetes/pull/25899
rpc
CreatePodSandbox
(
CreatePodSandboxRequest
)
returns
(
CreatePodSandboxResponse
)
{}
// StopPodSandbox stops the
sandbox. If there are any running containers in the
//
sandbox, they should be force
terminated.
// StopPodSandbox stops the
running sandbox. If there are any running
//
containers in the sandbox, they should be forcibly
terminated.
rpc
StopPodSandbox
(
StopPodSandboxRequest
)
returns
(
StopPodSandboxResponse
)
{}
//
DeletePodSandbox delet
es the sandbox. If there are any running containers in the
// sandbox, they should be forc
e delet
ed.
// It should return success if the sandbox has already been
delet
ed.
rpc
DeletePodSandbox
(
DeletePodSandboxRequest
)
returns
(
Delet
ePodSandboxResponse
)
{}
// PodSandboxStatus returns the
S
tatus of the PodSandbox.
//
RemovePodSandbox remov
es the sandbox. If there are any running containers in the
// sandbox, they should be forc
ibly remov
ed.
// It should return success if the sandbox has already been
remov
ed.
rpc
RemovePodSandbox
(
RemovePodSandboxRequest
)
returns
(
Remov
ePodSandboxResponse
)
{}
// PodSandboxStatus returns the
s
tatus of the PodSandbox.
rpc
PodSandboxStatus
(
PodSandboxStatusRequest
)
returns
(
PodSandboxStatusResponse
)
{}
// ListPodSandbox returns a list of SandBox.
rpc
ListPodSandbox
(
ListPodSandboxRequest
)
returns
(
ListPodSandboxResponse
)
{}
...
...
@@ -29,8 +29,8 @@ service RuntimeService {
rpc
StartContainer
(
StartContainerRequest
)
returns
(
StartContainerResponse
)
{}
// StopContainer stops a running container with a grace period (i.e., timeout).
rpc
StopContainer
(
StopContainerRequest
)
returns
(
StopContainerResponse
)
{}
// RemoveContainer removes the container. If the container is running, the
container
//
should be force
removed.
// RemoveContainer removes the container. If the container is running, the
//
container should be forcibly
removed.
// It should return success if the container has already been removed.
rpc
RemoveContainer
(
RemoveContainerRequest
)
returns
(
RemoveContainerResponse
)
{}
// ListContainers lists all containers by filters.
...
...
@@ -214,12 +214,12 @@ message StopPodSandboxRequest {
message
StopPodSandboxResponse
{}
message
Delet
ePodSandboxRequest
{
message
Remov
ePodSandboxRequest
{
// The id of the PodSandBox
optional
string
pod_sandbox_id
=
1
;
}
message
Delet
ePodSandboxResponse
{}
message
Remov
ePodSandboxResponse
{}
message
PodSandboxStatusRequest
{
// The id of the PodSandBox
...
...
@@ -318,8 +318,8 @@ message ListPodSandboxResponse {
}
// ImageSpec is an internal representation of an image. Currently, it wraps the
// value of a Container's Image field (e.g. imageName, imageName:tag, or
// imageName:digest), but in the future it will include more detailed
// value of a Container's Image field (e.g. imageName, imageName:tag, or
// imageName:digest), but in the future it will include more detailed
// information about the different image types.
message
ImageSpec
{
optional
string
image
=
1
;
...
...
pkg/kubelet/dockershim/docker_sandbox.go
View file @
5c06d7e6
...
...
@@ -72,9 +72,9 @@ func (ds *dockerService) StopPodSandbox(podSandboxID string) error {
// TODO: Stop all running containers in the sandbox.
}
//
DeletePodSandbox delet
es the sandbox. If there are running containers in the
// sandbox, they should be forcibly
delet
ed.
func
(
ds
*
dockerService
)
Delet
ePodSandbox
(
podSandboxID
string
)
error
{
//
RemovePodSandbox remov
es the sandbox. If there are running containers in the
// sandbox, they should be forcibly
remov
ed.
func
(
ds
*
dockerService
)
Remov
ePodSandbox
(
podSandboxID
string
)
error
{
return
ds
.
client
.
RemoveContainer
(
podSandboxID
,
dockertypes
.
ContainerRemoveOptions
{
RemoveVolumes
:
true
})
// TODO: remove all containers in the sandbox.
}
...
...
pkg/kubelet/remote/remote_runtime.go
View file @
5c06d7e6
...
...
@@ -97,17 +97,17 @@ func (r *RemoteRuntimeService) StopPodSandbox(podSandBoxID string) error {
return
nil
}
//
DeletePodSandbox delet
es the sandbox. If there are any containers in the
// sandbox, they should be forc
ed to deletion
.
func
(
r
*
RemoteRuntimeService
)
Delet
ePodSandbox
(
podSandBoxID
string
)
error
{
//
RemovePodSandbox remov
es the sandbox. If there are any containers in the
// sandbox, they should be forc
ibly removed
.
func
(
r
*
RemoteRuntimeService
)
Remov
ePodSandbox
(
podSandBoxID
string
)
error
{
ctx
,
cancel
:=
getContextWithTimeout
(
r
.
timeout
)
defer
cancel
()
_
,
err
:=
r
.
runtimeClient
.
DeletePodSandbox
(
ctx
,
&
runtimeApi
.
Delet
ePodSandboxRequest
{
_
,
err
:=
r
.
runtimeClient
.
RemovePodSandbox
(
ctx
,
&
runtimeApi
.
Remov
ePodSandboxRequest
{
PodSandboxId
:
&
podSandBoxID
,
})
if
err
!=
nil
{
glog
.
Errorf
(
"
Delet
ePodSandbox %q from runtime service failed: %v"
,
podSandBoxID
,
err
)
glog
.
Errorf
(
"
Remov
ePodSandbox %q from runtime service failed: %v"
,
podSandBoxID
,
err
)
return
err
}
...
...
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