mirror of
https://github.com/k3s-io/kubernetes.git
synced 2026-01-04 15:05:20 +00:00
dockershim: add unit tests for sandbox/container status
Also add a fake clock in the FakeDockerClient to allow testing container CreatedAt, StartedAt, FinishedAt timestamps.
This commit is contained in:
@@ -17,10 +17,14 @@ limitations under the License.
|
||||
package dockershim
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"k8s.io/kubernetes/pkg/kubelet/dockertools"
|
||||
"k8s.io/kubernetes/pkg/util/clock"
|
||||
)
|
||||
|
||||
func newTestDockerSevice() (*dockerService, *dockertools.FakeDockerClient) {
|
||||
func newTestDockerSevice() (*dockerService, *dockertools.FakeDockerClient, *clock.FakeClock) {
|
||||
c := dockertools.NewFakeDockerClient()
|
||||
return &dockerService{client: c}, c
|
||||
fakeClock := clock.NewFakeClock(time.Time{})
|
||||
return &dockerService{client: c}, c, fakeClock
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user