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
9f0dc7fe
Commit
9f0dc7fe
authored
Sep 15, 2016
by
Kubernetes Submit Queue
Committed by
GitHub
Sep 15, 2016
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #32744 from yujuhong/fix_shim
Automatic merge from submit-queue Clarify the "version" requirement in CRI and fix various bugs in dockershim This fixes #32741
parents
50eb1206
77aa4cd0
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
17 additions
and
11 deletions
+17
-11
api.pb.go
pkg/kubelet/api/v1alpha1/runtime/api.pb.go
+4
-2
api.proto
pkg/kubelet/api/v1alpha1/runtime/api.proto
+4
-2
docker_container.go
pkg/kubelet/dockershim/docker_container.go
+0
-1
docker_service.go
pkg/kubelet/dockershim/docker_service.go
+6
-3
helpers.go
pkg/kubelet/dockershim/helpers.go
+3
-3
No files found.
pkg/kubelet/api/v1alpha1/runtime/api.pb.go
View file @
9f0dc7fe
...
@@ -239,9 +239,11 @@ type VersionResponse struct {
...
@@ -239,9 +239,11 @@ type VersionResponse struct {
Version
*
string
`protobuf:"bytes,1,opt,name=version" json:"version,omitempty"`
Version
*
string
`protobuf:"bytes,1,opt,name=version" json:"version,omitempty"`
// The name of the container runtime.
// The name of the container runtime.
RuntimeName
*
string
`protobuf:"bytes,2,opt,name=runtime_name,json=runtimeName" json:"runtime_name,omitempty"`
RuntimeName
*
string
`protobuf:"bytes,2,opt,name=runtime_name,json=runtimeName" json:"runtime_name,omitempty"`
// The version of the container runtime.
// The version of the container runtime. The string should be
// semver-compatible.
RuntimeVersion
*
string
`protobuf:"bytes,3,opt,name=runtime_version,json=runtimeVersion" json:"runtime_version,omitempty"`
RuntimeVersion
*
string
`protobuf:"bytes,3,opt,name=runtime_version,json=runtimeVersion" json:"runtime_version,omitempty"`
// The API version of the container runtime.
// The API version of the container runtime. The string should be
// semver-compatible.
RuntimeApiVersion
*
string
`protobuf:"bytes,4,opt,name=runtime_api_version,json=runtimeApiVersion" json:"runtime_api_version,omitempty"`
RuntimeApiVersion
*
string
`protobuf:"bytes,4,opt,name=runtime_api_version,json=runtimeApiVersion" json:"runtime_api_version,omitempty"`
XXX_unrecognized
[]
byte
`json:"-"`
XXX_unrecognized
[]
byte
`json:"-"`
}
}
...
...
pkg/kubelet/api/v1alpha1/runtime/api.proto
View file @
9f0dc7fe
...
@@ -65,9 +65,11 @@ message VersionResponse {
...
@@ -65,9 +65,11 @@ message VersionResponse {
optional
string
version
=
1
;
optional
string
version
=
1
;
// The name of the container runtime.
// The name of the container runtime.
optional
string
runtime_name
=
2
;
optional
string
runtime_name
=
2
;
// The version of the container runtime.
// The version of the container runtime. The string should be
// semver-compatible.
optional
string
runtime_version
=
3
;
optional
string
runtime_version
=
3
;
// The API version of the container runtime.
// The API version of the container runtime. The string should be
// semver-compatible.
optional
string
runtime_api_version
=
4
;
optional
string
runtime_api_version
=
4
;
}
}
...
...
pkg/kubelet/dockershim/docker_container.go
View file @
9f0dc7fe
...
@@ -103,7 +103,6 @@ func (ds *dockerService) CreateContainer(podSandboxID string, config *runtimeApi
...
@@ -103,7 +103,6 @@ func (ds *dockerService) CreateContainer(podSandboxID string, config *runtimeApi
Name
:
makeContainerName
(
sandboxConfig
,
config
),
Name
:
makeContainerName
(
sandboxConfig
,
config
),
Config
:
&
dockercontainer
.
Config
{
Config
:
&
dockercontainer
.
Config
{
// TODO: set User.
// TODO: set User.
Hostname
:
sandboxConfig
.
GetHostname
(),
Entrypoint
:
dockerstrslice
.
StrSlice
(
config
.
GetCommand
()),
Entrypoint
:
dockerstrslice
.
StrSlice
(
config
.
GetCommand
()),
Cmd
:
dockerstrslice
.
StrSlice
(
config
.
GetArgs
()),
Cmd
:
dockerstrslice
.
StrSlice
(
config
.
GetArgs
()),
Env
:
generateEnvList
(
config
.
GetEnvs
()),
Env
:
generateEnvList
(
config
.
GetEnvs
()),
...
...
pkg/kubelet/dockershim/docker_service.go
View file @
9f0dc7fe
...
@@ -49,7 +49,7 @@ const (
...
@@ -49,7 +49,7 @@ const (
containerTypeLabelContainer
=
"container"
containerTypeLabelContainer
=
"container"
)
)
func
NewDockerSevice
(
client
dockertools
.
DockerInterface
)
DockerLegacyService
{
func
NewDockerSe
r
vice
(
client
dockertools
.
DockerInterface
)
DockerLegacyService
{
return
&
dockerService
{
return
&
dockerService
{
client
:
dockertools
.
NewInstrumentedDockerInterface
(
client
),
client
:
dockertools
.
NewInstrumentedDockerInterface
(
client
),
}
}
...
@@ -73,17 +73,20 @@ type dockerService struct {
...
@@ -73,17 +73,20 @@ type dockerService struct {
}
}
// Version returns the runtime name, runtime version and runtime API version
// Version returns the runtime name, runtime version and runtime API version
func
(
ds
*
dockerService
)
Version
(
apiVersion
string
)
(
*
runtimeApi
.
VersionResponse
,
error
)
{
func
(
ds
*
dockerService
)
Version
(
_
string
)
(
*
runtimeApi
.
VersionResponse
,
error
)
{
v
,
err
:=
ds
.
client
.
Version
()
v
,
err
:=
ds
.
client
.
Version
()
if
err
!=
nil
{
if
err
!=
nil
{
return
nil
,
fmt
.
Errorf
(
"docker: failed to get docker version: %v"
,
err
)
return
nil
,
fmt
.
Errorf
(
"docker: failed to get docker version: %v"
,
err
)
}
}
runtimeAPIVersion
:=
kubeAPIVersion
runtimeAPIVersion
:=
kubeAPIVersion
name
:=
dockerRuntimeName
name
:=
dockerRuntimeName
// Docker API version (e.g., 1.23) is not semver compatible. Add a ".0"
// suffix to remedy this.
apiVersion
:=
fmt
.
Sprintf
(
"%s.0"
,
v
.
APIVersion
)
return
&
runtimeApi
.
VersionResponse
{
return
&
runtimeApi
.
VersionResponse
{
Version
:
&
runtimeAPIVersion
,
Version
:
&
runtimeAPIVersion
,
RuntimeName
:
&
name
,
RuntimeName
:
&
name
,
RuntimeVersion
:
&
v
.
Version
,
RuntimeVersion
:
&
v
.
Version
,
RuntimeApiVersion
:
&
v
.
API
Version
,
RuntimeApiVersion
:
&
api
Version
,
},
nil
},
nil
}
}
pkg/kubelet/dockershim/helpers.go
View file @
9f0dc7fe
...
@@ -161,15 +161,15 @@ func getNetworkNamespace(c *dockertypes.ContainerJSON) string {
...
@@ -161,15 +161,15 @@ func getNetworkNamespace(c *dockertypes.ContainerJSON) string {
// dockerFilter wraps around dockerfilters.Args and provides methods to modify
// dockerFilter wraps around dockerfilters.Args and provides methods to modify
// the filter easily.
// the filter easily.
type
dockerFilter
struct
{
type
dockerFilter
struct
{
f
*
dockerfilters
.
Args
args
*
dockerfilters
.
Args
}
}
func
newDockerFilter
(
args
*
dockerfilters
.
Args
)
*
dockerFilter
{
func
newDockerFilter
(
args
*
dockerfilters
.
Args
)
*
dockerFilter
{
return
&
dockerFilter
{
f
:
args
}
return
&
dockerFilter
{
args
:
args
}
}
}
func
(
f
*
dockerFilter
)
Add
(
key
,
value
string
)
{
func
(
f
*
dockerFilter
)
Add
(
key
,
value
string
)
{
f
.
Add
(
key
,
value
)
f
.
args
.
Add
(
key
,
value
)
}
}
func
(
f
*
dockerFilter
)
AddLabel
(
key
,
value
string
)
{
func
(
f
*
dockerFilter
)
AddLabel
(
key
,
value
string
)
{
...
...
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