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
94bf2b0c
Commit
94bf2b0c
authored
Sep 13, 2017
by
Casey Davenport
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Attempt at fixing UTs
parent
be5cd7fe
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
1 deletion
+14
-1
kuberuntime_manager_test.go
pkg/kubelet/kuberuntime/kuberuntime_manager_test.go
+14
-1
No files found.
pkg/kubelet/kuberuntime/kuberuntime_manager_test.go
View file @
94bf2b0c
...
@@ -750,6 +750,7 @@ func makeBasePodAndStatus() (*v1.Pod, *kubecontainer.PodStatus) {
...
@@ -750,6 +750,7 @@ func makeBasePodAndStatus() (*v1.Pod, *kubecontainer.PodStatus) {
Id
:
"sandboxID"
,
Id
:
"sandboxID"
,
State
:
runtimeapi
.
PodSandboxState_SANDBOX_READY
,
State
:
runtimeapi
.
PodSandboxState_SANDBOX_READY
,
Metadata
:
&
runtimeapi
.
PodSandboxMetadata
{
Name
:
pod
.
Name
,
Namespace
:
pod
.
Namespace
,
Uid
:
"sandboxuid"
,
Attempt
:
uint32
(
0
)},
Metadata
:
&
runtimeapi
.
PodSandboxMetadata
{
Name
:
pod
.
Name
,
Namespace
:
pod
.
Namespace
,
Uid
:
"sandboxuid"
,
Attempt
:
uint32
(
0
)},
Network
:
&
runtimeapi
.
PodSandboxNetworkStatus
{
Ip
:
"10.0.0.1"
},
},
},
},
},
ContainerStatuses
:
[]
*
kubecontainer
.
ContainerStatus
{
ContainerStatuses
:
[]
*
kubecontainer
.
ContainerStatus
{
...
@@ -883,7 +884,19 @@ func TestComputePodActions(t *testing.T) {
...
@@ -883,7 +884,19 @@ func TestComputePodActions(t *testing.T) {
ContainersToKill
:
getKillMap
(
basePod
,
baseStatus
,
[]
int
{}),
ContainersToKill
:
getKillMap
(
basePod
,
baseStatus
,
[]
int
{}),
},
},
},
},
"Kill pod and recreate all containers if the PodSandbox does not have an IP"
:
{
mutateStatusFn
:
func
(
status
*
kubecontainer
.
PodStatus
)
{
status
.
SandboxStatuses
[
0
]
.
Network
.
Ip
=
""
},
actions
:
podActions
{
KillPod
:
true
,
CreateSandbox
:
true
,
SandboxID
:
baseStatus
.
SandboxStatuses
[
0
]
.
Id
,
Attempt
:
uint32
(
1
),
ContainersToStart
:
[]
int
{
0
,
1
,
2
},
ContainersToKill
:
getKillMap
(
basePod
,
baseStatus
,
[]
int
{}),
},
},
"Kill and recreate the container if the container's spec changed"
:
{
"Kill and recreate the container if the container's spec changed"
:
{
mutatePodFn
:
func
(
pod
*
v1
.
Pod
)
{
mutatePodFn
:
func
(
pod
*
v1
.
Pod
)
{
pod
.
Spec
.
RestartPolicy
=
v1
.
RestartPolicyAlways
pod
.
Spec
.
RestartPolicy
=
v1
.
RestartPolicyAlways
...
...
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