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
7a4ecc5c
Commit
7a4ecc5c
authored
Dec 28, 2016
by
Ivan Shvedunov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix bad time values in kubelet FakeRuntimeService
These values don't affect tests but they can be confusing for developers looking at the code for reference.
parent
53b43d6f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
fake_runtime_service.go
pkg/kubelet/api/testing/fake_runtime_service.go
+4
-4
No files found.
pkg/kubelet/api/testing/fake_runtime_service.go
View file @
7a4ecc5c
...
@@ -128,7 +128,7 @@ func (r *FakeRuntimeService) RunPodSandbox(config *runtimeapi.PodSandboxConfig)
...
@@ -128,7 +128,7 @@ func (r *FakeRuntimeService) RunPodSandbox(config *runtimeapi.PodSandboxConfig)
// PodSandboxID should be randomized for real container runtime, but here just use
// PodSandboxID should be randomized for real container runtime, but here just use
// fixed name from BuildSandboxName() for easily making fake sandboxes.
// fixed name from BuildSandboxName() for easily making fake sandboxes.
podSandboxID
:=
BuildSandboxName
(
config
.
Metadata
)
podSandboxID
:=
BuildSandboxName
(
config
.
Metadata
)
createdAt
:=
time
.
Now
()
.
Unix
()
createdAt
:=
time
.
Now
()
.
Unix
Nano
()
r
.
Sandboxes
[
podSandboxID
]
=
&
FakePodSandbox
{
r
.
Sandboxes
[
podSandboxID
]
=
&
FakePodSandbox
{
PodSandboxStatus
:
runtimeapi
.
PodSandboxStatus
{
PodSandboxStatus
:
runtimeapi
.
PodSandboxStatus
{
Id
:
podSandboxID
,
Id
:
podSandboxID
,
...
@@ -238,7 +238,7 @@ func (r *FakeRuntimeService) CreateContainer(podSandboxID string, config *runtim
...
@@ -238,7 +238,7 @@ func (r *FakeRuntimeService) CreateContainer(podSandboxID string, config *runtim
// ContainerID should be randomized for real container runtime, but here just use
// ContainerID should be randomized for real container runtime, but here just use
// fixed BuildContainerName() for easily making fake containers.
// fixed BuildContainerName() for easily making fake containers.
containerID
:=
BuildContainerName
(
config
.
Metadata
,
podSandboxID
)
containerID
:=
BuildContainerName
(
config
.
Metadata
,
podSandboxID
)
createdAt
:=
time
.
Now
()
.
Unix
()
createdAt
:=
time
.
Now
()
.
Unix
Nano
()
createdState
:=
runtimeapi
.
ContainerState_CONTAINER_CREATED
createdState
:=
runtimeapi
.
ContainerState_CONTAINER_CREATED
imageRef
:=
config
.
Image
.
Image
imageRef
:=
config
.
Image
.
Image
r
.
Containers
[
containerID
]
=
&
FakeContainer
{
r
.
Containers
[
containerID
]
=
&
FakeContainer
{
...
@@ -271,7 +271,7 @@ func (r *FakeRuntimeService) StartContainer(containerID string) error {
...
@@ -271,7 +271,7 @@ func (r *FakeRuntimeService) StartContainer(containerID string) error {
// Set container to running.
// Set container to running.
c
.
State
=
runtimeapi
.
ContainerState_CONTAINER_RUNNING
c
.
State
=
runtimeapi
.
ContainerState_CONTAINER_RUNNING
c
.
StartedAt
=
time
.
Now
()
.
Unix
()
c
.
StartedAt
=
time
.
Now
()
.
Unix
Nano
()
return
nil
return
nil
}
}
...
@@ -288,7 +288,7 @@ func (r *FakeRuntimeService) StopContainer(containerID string, timeout int64) er
...
@@ -288,7 +288,7 @@ func (r *FakeRuntimeService) StopContainer(containerID string, timeout int64) er
}
}
// Set container to exited state.
// Set container to exited state.
finishedAt
:=
time
.
Now
()
.
Unix
()
finishedAt
:=
time
.
Now
()
.
Unix
Nano
()
exitedState
:=
runtimeapi
.
ContainerState_CONTAINER_EXITED
exitedState
:=
runtimeapi
.
ContainerState_CONTAINER_EXITED
c
.
State
=
exitedState
c
.
State
=
exitedState
c
.
FinishedAt
=
finishedAt
c
.
FinishedAt
=
finishedAt
...
...
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