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
76afc730
Commit
76afc730
authored
Jan 20, 2017
by
Pengfei Ni
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kubelet/remote: update cri to protobuf v3
parent
8e4ea2dd
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
25 deletions
+25
-25
remote_image.go
pkg/kubelet/remote/remote_image.go
+4
-4
remote_runtime.go
pkg/kubelet/remote/remote_runtime.go
+21
-21
No files found.
pkg/kubelet/remote/remote_image.go
View file @
76afc730
...
@@ -71,7 +71,7 @@ func (r *RemoteImageService) ImageStatus(image *runtimeapi.ImageSpec) (*runtimea
...
@@ -71,7 +71,7 @@ func (r *RemoteImageService) ImageStatus(image *runtimeapi.ImageSpec) (*runtimea
Image
:
image
,
Image
:
image
,
})
})
if
err
!=
nil
{
if
err
!=
nil
{
glog
.
Errorf
(
"ImageStatus %q from image service failed: %v"
,
image
.
GetImage
()
,
err
)
glog
.
Errorf
(
"ImageStatus %q from image service failed: %v"
,
image
.
Image
,
err
)
return
nil
,
err
return
nil
,
err
}
}
...
@@ -88,11 +88,11 @@ func (r *RemoteImageService) PullImage(image *runtimeapi.ImageSpec, auth *runtim
...
@@ -88,11 +88,11 @@ func (r *RemoteImageService) PullImage(image *runtimeapi.ImageSpec, auth *runtim
Auth
:
auth
,
Auth
:
auth
,
})
})
if
err
!=
nil
{
if
err
!=
nil
{
glog
.
Errorf
(
"PullImage %q from image service failed: %v"
,
image
.
GetImage
()
,
err
)
glog
.
Errorf
(
"PullImage %q from image service failed: %v"
,
image
.
Image
,
err
)
return
""
,
err
return
""
,
err
}
}
return
resp
.
GetImageRef
()
,
nil
return
resp
.
ImageRef
,
nil
}
}
// RemoveImage removes the image.
// RemoveImage removes the image.
...
@@ -104,7 +104,7 @@ func (r *RemoteImageService) RemoveImage(image *runtimeapi.ImageSpec) error {
...
@@ -104,7 +104,7 @@ func (r *RemoteImageService) RemoveImage(image *runtimeapi.ImageSpec) error {
Image
:
image
,
Image
:
image
,
})
})
if
err
!=
nil
{
if
err
!=
nil
{
glog
.
Errorf
(
"RemoveImage %q from image service failed: %v"
,
image
.
GetImage
()
,
err
)
glog
.
Errorf
(
"RemoveImage %q from image service failed: %v"
,
image
.
Image
,
err
)
return
err
return
err
}
}
...
...
pkg/kubelet/remote/remote_runtime.go
View file @
76afc730
...
@@ -55,7 +55,7 @@ func (r *RemoteRuntimeService) Version(apiVersion string) (*runtimeapi.VersionRe
...
@@ -55,7 +55,7 @@ func (r *RemoteRuntimeService) Version(apiVersion string) (*runtimeapi.VersionRe
defer
cancel
()
defer
cancel
()
typedVersion
,
err
:=
r
.
runtimeClient
.
Version
(
ctx
,
&
runtimeapi
.
VersionRequest
{
typedVersion
,
err
:=
r
.
runtimeClient
.
Version
(
ctx
,
&
runtimeapi
.
VersionRequest
{
Version
:
&
apiVersion
,
Version
:
apiVersion
,
})
})
if
err
!=
nil
{
if
err
!=
nil
{
glog
.
Errorf
(
"Version from runtime service failed: %v"
,
err
)
glog
.
Errorf
(
"Version from runtime service failed: %v"
,
err
)
...
@@ -79,7 +79,7 @@ func (r *RemoteRuntimeService) RunPodSandbox(config *runtimeapi.PodSandboxConfig
...
@@ -79,7 +79,7 @@ func (r *RemoteRuntimeService) RunPodSandbox(config *runtimeapi.PodSandboxConfig
return
""
,
err
return
""
,
err
}
}
return
resp
.
GetPodSandboxId
()
,
nil
return
resp
.
PodSandboxId
,
nil
}
}
// StopPodSandbox stops the sandbox. If there are any running containers in the
// StopPodSandbox stops the sandbox. If there are any running containers in the
...
@@ -89,7 +89,7 @@ func (r *RemoteRuntimeService) StopPodSandbox(podSandBoxID string) error {
...
@@ -89,7 +89,7 @@ func (r *RemoteRuntimeService) StopPodSandbox(podSandBoxID string) error {
defer
cancel
()
defer
cancel
()
_
,
err
:=
r
.
runtimeClient
.
StopPodSandbox
(
ctx
,
&
runtimeapi
.
StopPodSandboxRequest
{
_
,
err
:=
r
.
runtimeClient
.
StopPodSandbox
(
ctx
,
&
runtimeapi
.
StopPodSandboxRequest
{
PodSandboxId
:
&
podSandBoxID
,
PodSandboxId
:
podSandBoxID
,
})
})
if
err
!=
nil
{
if
err
!=
nil
{
glog
.
Errorf
(
"StopPodSandbox %q from runtime service failed: %v"
,
podSandBoxID
,
err
)
glog
.
Errorf
(
"StopPodSandbox %q from runtime service failed: %v"
,
podSandBoxID
,
err
)
...
@@ -106,7 +106,7 @@ func (r *RemoteRuntimeService) RemovePodSandbox(podSandBoxID string) error {
...
@@ -106,7 +106,7 @@ func (r *RemoteRuntimeService) RemovePodSandbox(podSandBoxID string) error {
defer
cancel
()
defer
cancel
()
_
,
err
:=
r
.
runtimeClient
.
RemovePodSandbox
(
ctx
,
&
runtimeapi
.
RemovePodSandboxRequest
{
_
,
err
:=
r
.
runtimeClient
.
RemovePodSandbox
(
ctx
,
&
runtimeapi
.
RemovePodSandboxRequest
{
PodSandboxId
:
&
podSandBoxID
,
PodSandboxId
:
podSandBoxID
,
})
})
if
err
!=
nil
{
if
err
!=
nil
{
glog
.
Errorf
(
"RemovePodSandbox %q from runtime service failed: %v"
,
podSandBoxID
,
err
)
glog
.
Errorf
(
"RemovePodSandbox %q from runtime service failed: %v"
,
podSandBoxID
,
err
)
...
@@ -122,7 +122,7 @@ func (r *RemoteRuntimeService) PodSandboxStatus(podSandBoxID string) (*runtimeap
...
@@ -122,7 +122,7 @@ func (r *RemoteRuntimeService) PodSandboxStatus(podSandBoxID string) (*runtimeap
defer
cancel
()
defer
cancel
()
resp
,
err
:=
r
.
runtimeClient
.
PodSandboxStatus
(
ctx
,
&
runtimeapi
.
PodSandboxStatusRequest
{
resp
,
err
:=
r
.
runtimeClient
.
PodSandboxStatus
(
ctx
,
&
runtimeapi
.
PodSandboxStatusRequest
{
PodSandboxId
:
&
podSandBoxID
,
PodSandboxId
:
podSandBoxID
,
})
})
if
err
!=
nil
{
if
err
!=
nil
{
glog
.
Errorf
(
"PodSandboxStatus %q from runtime service failed: %v"
,
podSandBoxID
,
err
)
glog
.
Errorf
(
"PodSandboxStatus %q from runtime service failed: %v"
,
podSandBoxID
,
err
)
...
@@ -154,7 +154,7 @@ func (r *RemoteRuntimeService) CreateContainer(podSandBoxID string, config *runt
...
@@ -154,7 +154,7 @@ func (r *RemoteRuntimeService) CreateContainer(podSandBoxID string, config *runt
defer
cancel
()
defer
cancel
()
resp
,
err
:=
r
.
runtimeClient
.
CreateContainer
(
ctx
,
&
runtimeapi
.
CreateContainerRequest
{
resp
,
err
:=
r
.
runtimeClient
.
CreateContainer
(
ctx
,
&
runtimeapi
.
CreateContainerRequest
{
PodSandboxId
:
&
podSandBoxID
,
PodSandboxId
:
podSandBoxID
,
Config
:
config
,
Config
:
config
,
SandboxConfig
:
sandboxConfig
,
SandboxConfig
:
sandboxConfig
,
})
})
...
@@ -163,7 +163,7 @@ func (r *RemoteRuntimeService) CreateContainer(podSandBoxID string, config *runt
...
@@ -163,7 +163,7 @@ func (r *RemoteRuntimeService) CreateContainer(podSandBoxID string, config *runt
return
""
,
err
return
""
,
err
}
}
return
resp
.
GetContainerId
()
,
nil
return
resp
.
ContainerId
,
nil
}
}
// StartContainer starts the container.
// StartContainer starts the container.
...
@@ -172,7 +172,7 @@ func (r *RemoteRuntimeService) StartContainer(containerID string) error {
...
@@ -172,7 +172,7 @@ func (r *RemoteRuntimeService) StartContainer(containerID string) error {
defer
cancel
()
defer
cancel
()
_
,
err
:=
r
.
runtimeClient
.
StartContainer
(
ctx
,
&
runtimeapi
.
StartContainerRequest
{
_
,
err
:=
r
.
runtimeClient
.
StartContainer
(
ctx
,
&
runtimeapi
.
StartContainerRequest
{
ContainerId
:
&
containerID
,
ContainerId
:
containerID
,
})
})
if
err
!=
nil
{
if
err
!=
nil
{
glog
.
Errorf
(
"StartContainer %q from runtime service failed: %v"
,
containerID
,
err
)
glog
.
Errorf
(
"StartContainer %q from runtime service failed: %v"
,
containerID
,
err
)
...
@@ -188,8 +188,8 @@ func (r *RemoteRuntimeService) StopContainer(containerID string, timeout int64)
...
@@ -188,8 +188,8 @@ func (r *RemoteRuntimeService) StopContainer(containerID string, timeout int64)
defer
cancel
()
defer
cancel
()
_
,
err
:=
r
.
runtimeClient
.
StopContainer
(
ctx
,
&
runtimeapi
.
StopContainerRequest
{
_
,
err
:=
r
.
runtimeClient
.
StopContainer
(
ctx
,
&
runtimeapi
.
StopContainerRequest
{
ContainerId
:
&
containerID
,
ContainerId
:
containerID
,
Timeout
:
&
timeout
,
Timeout
:
timeout
,
})
})
if
err
!=
nil
{
if
err
!=
nil
{
glog
.
Errorf
(
"StopContainer %q from runtime service failed: %v"
,
containerID
,
err
)
glog
.
Errorf
(
"StopContainer %q from runtime service failed: %v"
,
containerID
,
err
)
...
@@ -206,7 +206,7 @@ func (r *RemoteRuntimeService) RemoveContainer(containerID string) error {
...
@@ -206,7 +206,7 @@ func (r *RemoteRuntimeService) RemoveContainer(containerID string) error {
defer
cancel
()
defer
cancel
()
_
,
err
:=
r
.
runtimeClient
.
RemoveContainer
(
ctx
,
&
runtimeapi
.
RemoveContainerRequest
{
_
,
err
:=
r
.
runtimeClient
.
RemoveContainer
(
ctx
,
&
runtimeapi
.
RemoveContainerRequest
{
ContainerId
:
&
containerID
,
ContainerId
:
containerID
,
})
})
if
err
!=
nil
{
if
err
!=
nil
{
glog
.
Errorf
(
"RemoveContainer %q from runtime service failed: %v"
,
containerID
,
err
)
glog
.
Errorf
(
"RemoveContainer %q from runtime service failed: %v"
,
containerID
,
err
)
...
@@ -238,7 +238,7 @@ func (r *RemoteRuntimeService) ContainerStatus(containerID string) (*runtimeapi.
...
@@ -238,7 +238,7 @@ func (r *RemoteRuntimeService) ContainerStatus(containerID string) (*runtimeapi.
defer
cancel
()
defer
cancel
()
resp
,
err
:=
r
.
runtimeClient
.
ContainerStatus
(
ctx
,
&
runtimeapi
.
ContainerStatusRequest
{
resp
,
err
:=
r
.
runtimeClient
.
ContainerStatus
(
ctx
,
&
runtimeapi
.
ContainerStatusRequest
{
ContainerId
:
&
containerID
,
ContainerId
:
containerID
,
})
})
if
err
!=
nil
{
if
err
!=
nil
{
glog
.
Errorf
(
"ContainerStatus %q from runtime service failed: %v"
,
containerID
,
err
)
glog
.
Errorf
(
"ContainerStatus %q from runtime service failed: %v"
,
containerID
,
err
)
...
@@ -256,9 +256,9 @@ func (r *RemoteRuntimeService) ExecSync(containerID string, cmd []string, timeou
...
@@ -256,9 +256,9 @@ func (r *RemoteRuntimeService) ExecSync(containerID string, cmd []string, timeou
timeoutSeconds
:=
int64
(
timeout
.
Seconds
())
timeoutSeconds
:=
int64
(
timeout
.
Seconds
())
req
:=
&
runtimeapi
.
ExecSyncRequest
{
req
:=
&
runtimeapi
.
ExecSyncRequest
{
ContainerId
:
&
containerID
,
ContainerId
:
containerID
,
Cmd
:
cmd
,
Cmd
:
cmd
,
Timeout
:
&
timeoutSeconds
,
Timeout
:
timeoutSeconds
,
}
}
resp
,
err
:=
r
.
runtimeClient
.
ExecSync
(
ctx
,
req
)
resp
,
err
:=
r
.
runtimeClient
.
ExecSync
(
ctx
,
req
)
if
err
!=
nil
{
if
err
!=
nil
{
...
@@ -267,14 +267,14 @@ func (r *RemoteRuntimeService) ExecSync(containerID string, cmd []string, timeou
...
@@ -267,14 +267,14 @@ func (r *RemoteRuntimeService) ExecSync(containerID string, cmd []string, timeou
}
}
err
=
nil
err
=
nil
if
resp
.
GetExitCode
()
!=
0
{
if
resp
.
ExitCode
!=
0
{
err
=
utilexec
.
CodeExitError
{
err
=
utilexec
.
CodeExitError
{
Err
:
fmt
.
Errorf
(
"command '%s' exited with %d: %s"
,
strings
.
Join
(
cmd
,
" "
),
resp
.
GetExitCode
(),
resp
.
GetStderr
()
),
Err
:
fmt
.
Errorf
(
"command '%s' exited with %d: %s"
,
strings
.
Join
(
cmd
,
" "
),
resp
.
ExitCode
,
resp
.
Stderr
),
Code
:
int
(
resp
.
GetExitCode
()
),
Code
:
int
(
resp
.
ExitCode
),
}
}
}
}
return
resp
.
GetStdout
(),
resp
.
GetStderr
()
,
err
return
resp
.
Stdout
,
resp
.
Stderr
,
err
}
}
// Exec prepares a streaming endpoint to execute a command in the container, and returns the address.
// Exec prepares a streaming endpoint to execute a command in the container, and returns the address.
...
@@ -284,7 +284,7 @@ func (r *RemoteRuntimeService) Exec(req *runtimeapi.ExecRequest) (*runtimeapi.Ex
...
@@ -284,7 +284,7 @@ func (r *RemoteRuntimeService) Exec(req *runtimeapi.ExecRequest) (*runtimeapi.Ex
resp
,
err
:=
r
.
runtimeClient
.
Exec
(
ctx
,
req
)
resp
,
err
:=
r
.
runtimeClient
.
Exec
(
ctx
,
req
)
if
err
!=
nil
{
if
err
!=
nil
{
glog
.
Errorf
(
"Exec %s '%s' from runtime service failed: %v"
,
req
.
GetContainerId
(),
strings
.
Join
(
req
.
GetCmd
()
,
" "
),
err
)
glog
.
Errorf
(
"Exec %s '%s' from runtime service failed: %v"
,
req
.
ContainerId
,
strings
.
Join
(
req
.
Cmd
,
" "
),
err
)
return
nil
,
err
return
nil
,
err
}
}
...
@@ -298,7 +298,7 @@ func (r *RemoteRuntimeService) Attach(req *runtimeapi.AttachRequest) (*runtimeap
...
@@ -298,7 +298,7 @@ func (r *RemoteRuntimeService) Attach(req *runtimeapi.AttachRequest) (*runtimeap
resp
,
err
:=
r
.
runtimeClient
.
Attach
(
ctx
,
req
)
resp
,
err
:=
r
.
runtimeClient
.
Attach
(
ctx
,
req
)
if
err
!=
nil
{
if
err
!=
nil
{
glog
.
Errorf
(
"Attach %s from runtime service failed: %v"
,
req
.
GetContainerId
()
,
err
)
glog
.
Errorf
(
"Attach %s from runtime service failed: %v"
,
req
.
ContainerId
,
err
)
return
nil
,
err
return
nil
,
err
}
}
...
@@ -312,7 +312,7 @@ func (r *RemoteRuntimeService) PortForward(req *runtimeapi.PortForwardRequest) (
...
@@ -312,7 +312,7 @@ func (r *RemoteRuntimeService) PortForward(req *runtimeapi.PortForwardRequest) (
resp
,
err
:=
r
.
runtimeClient
.
PortForward
(
ctx
,
req
)
resp
,
err
:=
r
.
runtimeClient
.
PortForward
(
ctx
,
req
)
if
err
!=
nil
{
if
err
!=
nil
{
glog
.
Errorf
(
"PortForward %s from runtime service failed: %v"
,
req
.
GetPodSandboxId
()
,
err
)
glog
.
Errorf
(
"PortForward %s from runtime service failed: %v"
,
req
.
PodSandboxId
,
err
)
return
nil
,
err
return
nil
,
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