mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 03:41:45 +00:00
kubelet: add CheckpointContainer() to the runtime
Signed-off-by: Adrian Reber <areber@redhat.com>
This commit is contained in:
parent
3e6f50683f
commit
8c24857ba3
@ -119,6 +119,9 @@ type Runtime interface {
|
|||||||
// This method just proxies a new runtimeConfig with the updated
|
// This method just proxies a new runtimeConfig with the updated
|
||||||
// CIDR value down to the runtime shim.
|
// CIDR value down to the runtime shim.
|
||||||
UpdatePodCIDR(podCIDR string) error
|
UpdatePodCIDR(podCIDR string) error
|
||||||
|
// CheckpointContainer tells the runtime to checkpoint a container
|
||||||
|
// and store the resulting archive to the checkpoint directory.
|
||||||
|
CheckpointContainer(options *runtimeapi.CheckpointContainerRequest) error
|
||||||
}
|
}
|
||||||
|
|
||||||
// StreamingRuntime is the interface implemented by runtimes that handle the serving of the
|
// StreamingRuntime is the interface implemented by runtimes that handle the serving of the
|
||||||
|
@ -362,6 +362,14 @@ func (f *FakeRuntime) DeleteContainer(containerID kubecontainer.ContainerID) err
|
|||||||
return f.Err
|
return f.Err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (f *FakeRuntime) CheckpointContainer(options *runtimeapi.CheckpointContainerRequest) error {
|
||||||
|
f.Lock()
|
||||||
|
defer f.Unlock()
|
||||||
|
|
||||||
|
f.CalledFunctions = append(f.CalledFunctions, "CheckpointContainer")
|
||||||
|
return f.Err
|
||||||
|
}
|
||||||
|
|
||||||
func (f *FakeRuntime) ImageStats() (*kubecontainer.ImageStats, error) {
|
func (f *FakeRuntime) ImageStats() (*kubecontainer.ImageStats, error) {
|
||||||
f.Lock()
|
f.Lock()
|
||||||
defer f.Unlock()
|
defer f.Unlock()
|
||||||
|
@ -126,6 +126,20 @@ func (mr *MockRuntimeMockRecorder) APIVersion() *gomock.Call {
|
|||||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "APIVersion", reflect.TypeOf((*MockRuntime)(nil).APIVersion))
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "APIVersion", reflect.TypeOf((*MockRuntime)(nil).APIVersion))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// CheckpointContainer mocks base method.
|
||||||
|
func (m *MockRuntime) CheckpointContainer(options *v10.CheckpointContainerRequest) error {
|
||||||
|
m.ctrl.T.Helper()
|
||||||
|
ret := m.ctrl.Call(m, "CheckpointContainer", options)
|
||||||
|
ret0, _ := ret[0].(error)
|
||||||
|
return ret0
|
||||||
|
}
|
||||||
|
|
||||||
|
// CheckpointContainer indicates an expected call of CheckpointContainer.
|
||||||
|
func (mr *MockRuntimeMockRecorder) CheckpointContainer(options interface{}) *gomock.Call {
|
||||||
|
mr.mock.ctrl.T.Helper()
|
||||||
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CheckpointContainer", reflect.TypeOf((*MockRuntime)(nil).CheckpointContainer), options)
|
||||||
|
}
|
||||||
|
|
||||||
// DeleteContainer mocks base method.
|
// DeleteContainer mocks base method.
|
||||||
func (m *MockRuntime) DeleteContainer(containerID container.ContainerID) error {
|
func (m *MockRuntime) DeleteContainer(containerID container.ContainerID) error {
|
||||||
m.ctrl.T.Helper()
|
m.ctrl.T.Helper()
|
||||||
|
@ -1100,3 +1100,7 @@ func (m *kubeGenericRuntimeManager) UpdatePodCIDR(podCIDR string) error {
|
|||||||
},
|
},
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (m *kubeGenericRuntimeManager) CheckpointContainer(options *runtimeapi.CheckpointContainerRequest) error {
|
||||||
|
return m.runtimeService.CheckpointContainer(options)
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user