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
5b78dc8b
Commit
5b78dc8b
authored
Nov 12, 2018
by
liucimin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix_the_checkpoint_no_hostip_bug
parent
afcc1568
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
9 additions
and
0 deletions
+9
-0
checkpoint_manager_test.go
pkg/kubelet/checkpointmanager/checkpoint_manager_test.go
+5
-0
docker_checkpoint.go
pkg/kubelet/dockershim/docker_checkpoint.go
+2
-0
docker_sandbox.go
pkg/kubelet/dockershim/docker_sandbox.go
+1
-0
docker_service.go
pkg/kubelet/dockershim/docker_service.go
+1
-0
No files found.
pkg/kubelet/checkpointmanager/checkpoint_manager_test.go
View file @
5b78dc8b
...
@@ -56,6 +56,8 @@ type PortMapping struct {
...
@@ -56,6 +56,8 @@ type PortMapping struct {
ContainerPort
*
int32
ContainerPort
*
int32
// Port number on the host.
// Port number on the host.
HostPort
*
int32
HostPort
*
int32
// Host ip to expose.
HostIP
string
}
}
// CheckpointData is a sample example structure to be used in test cases for checkpointing
// CheckpointData is a sample example structure to be used in test cases for checkpointing
...
@@ -151,17 +153,20 @@ func TestCheckpointManager(t *testing.T) {
...
@@ -151,17 +153,20 @@ func TestCheckpointManager(t *testing.T) {
port80
:=
int32
(
80
)
port80
:=
int32
(
80
)
port443
:=
int32
(
443
)
port443
:=
int32
(
443
)
proto
:=
protocol
(
"tcp"
)
proto
:=
protocol
(
"tcp"
)
ip1234
:=
"1.2.3.4"
portMappings
:=
[]
*
PortMapping
{
portMappings
:=
[]
*
PortMapping
{
{
{
&
proto
,
&
proto
,
&
port80
,
&
port80
,
&
port80
,
&
port80
,
ip1234
,
},
},
{
{
&
proto
,
&
proto
,
&
port443
,
&
port443
,
&
port443
,
&
port443
,
ip1234
,
},
},
}
}
checkpoint1
:=
newFakeCheckpointV1
(
"check1"
,
portMappings
,
true
)
checkpoint1
:=
newFakeCheckpointV1
(
"check1"
,
portMappings
,
true
)
...
...
pkg/kubelet/dockershim/docker_checkpoint.go
View file @
5b78dc8b
...
@@ -46,6 +46,8 @@ type PortMapping struct {
...
@@ -46,6 +46,8 @@ type PortMapping struct {
ContainerPort
*
int32
`json:"container_port,omitempty"`
ContainerPort
*
int32
`json:"container_port,omitempty"`
// Port number on the host.
// Port number on the host.
HostPort
*
int32
`json:"host_port,omitempty"`
HostPort
*
int32
`json:"host_port,omitempty"`
// Host ip to expose.
HostIP
string
`json:"host_ip,omitempty"`
}
}
// CheckpointData contains all types of data that can be stored in the checkpoint.
// CheckpointData contains all types of data that can be stored in the checkpoint.
...
...
pkg/kubelet/dockershim/docker_sandbox.go
View file @
5b78dc8b
...
@@ -643,6 +643,7 @@ func constructPodSandboxCheckpoint(config *runtimeapi.PodSandboxConfig) checkpoi
...
@@ -643,6 +643,7 @@ func constructPodSandboxCheckpoint(config *runtimeapi.PodSandboxConfig) checkpoi
HostPort
:
&
pm
.
HostPort
,
HostPort
:
&
pm
.
HostPort
,
ContainerPort
:
&
pm
.
ContainerPort
,
ContainerPort
:
&
pm
.
ContainerPort
,
Protocol
:
&
proto
,
Protocol
:
&
proto
,
HostIP
:
pm
.
HostIp
,
})
})
}
}
if
config
.
GetLinux
()
.
GetSecurityContext
()
.
GetNamespaceOptions
()
.
GetNetwork
()
==
runtimeapi
.
NamespaceMode_NODE
{
if
config
.
GetLinux
()
.
GetSecurityContext
()
.
GetNamespaceOptions
()
.
GetNetwork
()
==
runtimeapi
.
NamespaceMode_NODE
{
...
...
pkg/kubelet/dockershim/docker_service.go
View file @
5b78dc8b
...
@@ -394,6 +394,7 @@ func (ds *dockerService) GetPodPortMappings(podSandboxID string) ([]*hostport.Po
...
@@ -394,6 +394,7 @@ func (ds *dockerService) GetPodPortMappings(podSandboxID string) ([]*hostport.Po
HostPort
:
*
pm
.
HostPort
,
HostPort
:
*
pm
.
HostPort
,
ContainerPort
:
*
pm
.
ContainerPort
,
ContainerPort
:
*
pm
.
ContainerPort
,
Protocol
:
proto
,
Protocol
:
proto
,
HostIP
:
pm
.
HostIP
,
})
})
}
}
return
portMappings
,
nil
return
portMappings
,
nil
...
...
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