|
|
|
|
@@ -28,8 +28,6 @@ import (
|
|
|
|
|
|
|
|
|
|
context "context"
|
|
|
|
|
|
|
|
|
|
corev1 "k8s.io/api/core/v1"
|
|
|
|
|
|
|
|
|
|
cri "k8s.io/cri-api/pkg/apis"
|
|
|
|
|
|
|
|
|
|
framework "k8s.io/kubernetes/pkg/scheduler/framework"
|
|
|
|
|
@@ -40,13 +38,15 @@ import (
|
|
|
|
|
|
|
|
|
|
mock "github.com/stretchr/testify/mock"
|
|
|
|
|
|
|
|
|
|
podresourcesv1 "k8s.io/kubelet/pkg/apis/podresources/v1"
|
|
|
|
|
|
|
|
|
|
resourceupdates "k8s.io/kubernetes/pkg/kubelet/cm/resourceupdates"
|
|
|
|
|
|
|
|
|
|
status "k8s.io/kubernetes/pkg/kubelet/status"
|
|
|
|
|
|
|
|
|
|
types "k8s.io/apimachinery/pkg/types"
|
|
|
|
|
|
|
|
|
|
v1 "k8s.io/kubelet/pkg/apis/podresources/v1"
|
|
|
|
|
v1 "k8s.io/api/core/v1"
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
// MockContainerManager is an autogenerated mock type for the ContainerManager type
|
|
|
|
|
@@ -62,6 +62,53 @@ func (_m *MockContainerManager) EXPECT() *MockContainerManager_Expecter {
|
|
|
|
|
return &MockContainerManager_Expecter{mock: &_m.Mock}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// ContainerHasExclusiveCPUs provides a mock function with given fields: pod, _a1
|
|
|
|
|
func (_m *MockContainerManager) ContainerHasExclusiveCPUs(pod *v1.Pod, _a1 *v1.Container) bool {
|
|
|
|
|
ret := _m.Called(pod, _a1)
|
|
|
|
|
|
|
|
|
|
if len(ret) == 0 {
|
|
|
|
|
panic("no return value specified for ContainerHasExclusiveCPUs")
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var r0 bool
|
|
|
|
|
if rf, ok := ret.Get(0).(func(*v1.Pod, *v1.Container) bool); ok {
|
|
|
|
|
r0 = rf(pod, _a1)
|
|
|
|
|
} else {
|
|
|
|
|
r0 = ret.Get(0).(bool)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return r0
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// MockContainerManager_ContainerHasExclusiveCPUs_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ContainerHasExclusiveCPUs'
|
|
|
|
|
type MockContainerManager_ContainerHasExclusiveCPUs_Call struct {
|
|
|
|
|
*mock.Call
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// ContainerHasExclusiveCPUs is a helper method to define mock.On call
|
|
|
|
|
// - pod *v1.Pod
|
|
|
|
|
// - _a1 *v1.Container
|
|
|
|
|
func (_e *MockContainerManager_Expecter) ContainerHasExclusiveCPUs(pod interface{}, _a1 interface{}) *MockContainerManager_ContainerHasExclusiveCPUs_Call {
|
|
|
|
|
return &MockContainerManager_ContainerHasExclusiveCPUs_Call{Call: _e.mock.On("ContainerHasExclusiveCPUs", pod, _a1)}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (_c *MockContainerManager_ContainerHasExclusiveCPUs_Call) Run(run func(pod *v1.Pod, _a1 *v1.Container)) *MockContainerManager_ContainerHasExclusiveCPUs_Call {
|
|
|
|
|
_c.Call.Run(func(args mock.Arguments) {
|
|
|
|
|
run(args[0].(*v1.Pod), args[1].(*v1.Container))
|
|
|
|
|
})
|
|
|
|
|
return _c
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (_c *MockContainerManager_ContainerHasExclusiveCPUs_Call) Return(_a0 bool) *MockContainerManager_ContainerHasExclusiveCPUs_Call {
|
|
|
|
|
_c.Call.Return(_a0)
|
|
|
|
|
return _c
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (_c *MockContainerManager_ContainerHasExclusiveCPUs_Call) RunAndReturn(run func(*v1.Pod, *v1.Container) bool) *MockContainerManager_ContainerHasExclusiveCPUs_Call {
|
|
|
|
|
_c.Call.Return(run)
|
|
|
|
|
return _c
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// GetAllocatableCPUs provides a mock function with given fields:
|
|
|
|
|
func (_m *MockContainerManager) GetAllocatableCPUs() []int64 {
|
|
|
|
|
ret := _m.Called()
|
|
|
|
|
@@ -110,19 +157,19 @@ func (_c *MockContainerManager_GetAllocatableCPUs_Call) RunAndReturn(run func()
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// GetAllocatableDevices provides a mock function with given fields:
|
|
|
|
|
func (_m *MockContainerManager) GetAllocatableDevices() []*v1.ContainerDevices {
|
|
|
|
|
func (_m *MockContainerManager) GetAllocatableDevices() []*podresourcesv1.ContainerDevices {
|
|
|
|
|
ret := _m.Called()
|
|
|
|
|
|
|
|
|
|
if len(ret) == 0 {
|
|
|
|
|
panic("no return value specified for GetAllocatableDevices")
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var r0 []*v1.ContainerDevices
|
|
|
|
|
if rf, ok := ret.Get(0).(func() []*v1.ContainerDevices); ok {
|
|
|
|
|
var r0 []*podresourcesv1.ContainerDevices
|
|
|
|
|
if rf, ok := ret.Get(0).(func() []*podresourcesv1.ContainerDevices); ok {
|
|
|
|
|
r0 = rf()
|
|
|
|
|
} else {
|
|
|
|
|
if ret.Get(0) != nil {
|
|
|
|
|
r0 = ret.Get(0).([]*v1.ContainerDevices)
|
|
|
|
|
r0 = ret.Get(0).([]*podresourcesv1.ContainerDevices)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -146,30 +193,30 @@ func (_c *MockContainerManager_GetAllocatableDevices_Call) Run(run func()) *Mock
|
|
|
|
|
return _c
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (_c *MockContainerManager_GetAllocatableDevices_Call) Return(_a0 []*v1.ContainerDevices) *MockContainerManager_GetAllocatableDevices_Call {
|
|
|
|
|
func (_c *MockContainerManager_GetAllocatableDevices_Call) Return(_a0 []*podresourcesv1.ContainerDevices) *MockContainerManager_GetAllocatableDevices_Call {
|
|
|
|
|
_c.Call.Return(_a0)
|
|
|
|
|
return _c
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (_c *MockContainerManager_GetAllocatableDevices_Call) RunAndReturn(run func() []*v1.ContainerDevices) *MockContainerManager_GetAllocatableDevices_Call {
|
|
|
|
|
func (_c *MockContainerManager_GetAllocatableDevices_Call) RunAndReturn(run func() []*podresourcesv1.ContainerDevices) *MockContainerManager_GetAllocatableDevices_Call {
|
|
|
|
|
_c.Call.Return(run)
|
|
|
|
|
return _c
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// GetAllocatableMemory provides a mock function with given fields:
|
|
|
|
|
func (_m *MockContainerManager) GetAllocatableMemory() []*v1.ContainerMemory {
|
|
|
|
|
func (_m *MockContainerManager) GetAllocatableMemory() []*podresourcesv1.ContainerMemory {
|
|
|
|
|
ret := _m.Called()
|
|
|
|
|
|
|
|
|
|
if len(ret) == 0 {
|
|
|
|
|
panic("no return value specified for GetAllocatableMemory")
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var r0 []*v1.ContainerMemory
|
|
|
|
|
if rf, ok := ret.Get(0).(func() []*v1.ContainerMemory); ok {
|
|
|
|
|
var r0 []*podresourcesv1.ContainerMemory
|
|
|
|
|
if rf, ok := ret.Get(0).(func() []*podresourcesv1.ContainerMemory); ok {
|
|
|
|
|
r0 = rf()
|
|
|
|
|
} else {
|
|
|
|
|
if ret.Get(0) != nil {
|
|
|
|
|
r0 = ret.Get(0).([]*v1.ContainerMemory)
|
|
|
|
|
r0 = ret.Get(0).([]*podresourcesv1.ContainerMemory)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -193,12 +240,12 @@ func (_c *MockContainerManager_GetAllocatableMemory_Call) Run(run func()) *MockC
|
|
|
|
|
return _c
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (_c *MockContainerManager_GetAllocatableMemory_Call) Return(_a0 []*v1.ContainerMemory) *MockContainerManager_GetAllocatableMemory_Call {
|
|
|
|
|
func (_c *MockContainerManager_GetAllocatableMemory_Call) Return(_a0 []*podresourcesv1.ContainerMemory) *MockContainerManager_GetAllocatableMemory_Call {
|
|
|
|
|
_c.Call.Return(_a0)
|
|
|
|
|
return _c
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (_c *MockContainerManager_GetAllocatableMemory_Call) RunAndReturn(run func() []*v1.ContainerMemory) *MockContainerManager_GetAllocatableMemory_Call {
|
|
|
|
|
func (_c *MockContainerManager_GetAllocatableMemory_Call) RunAndReturn(run func() []*podresourcesv1.ContainerMemory) *MockContainerManager_GetAllocatableMemory_Call {
|
|
|
|
|
_c.Call.Return(run)
|
|
|
|
|
return _c
|
|
|
|
|
}
|
|
|
|
|
@@ -300,19 +347,19 @@ func (_c *MockContainerManager_GetCPUs_Call) RunAndReturn(run func(string, strin
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// GetCapacity provides a mock function with given fields: localStorageCapacityIsolation
|
|
|
|
|
func (_m *MockContainerManager) GetCapacity(localStorageCapacityIsolation bool) corev1.ResourceList {
|
|
|
|
|
func (_m *MockContainerManager) GetCapacity(localStorageCapacityIsolation bool) v1.ResourceList {
|
|
|
|
|
ret := _m.Called(localStorageCapacityIsolation)
|
|
|
|
|
|
|
|
|
|
if len(ret) == 0 {
|
|
|
|
|
panic("no return value specified for GetCapacity")
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var r0 corev1.ResourceList
|
|
|
|
|
if rf, ok := ret.Get(0).(func(bool) corev1.ResourceList); ok {
|
|
|
|
|
var r0 v1.ResourceList
|
|
|
|
|
if rf, ok := ret.Get(0).(func(bool) v1.ResourceList); ok {
|
|
|
|
|
r0 = rf(localStorageCapacityIsolation)
|
|
|
|
|
} else {
|
|
|
|
|
if ret.Get(0) != nil {
|
|
|
|
|
r0 = ret.Get(0).(corev1.ResourceList)
|
|
|
|
|
r0 = ret.Get(0).(v1.ResourceList)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -337,43 +384,43 @@ func (_c *MockContainerManager_GetCapacity_Call) Run(run func(localStorageCapaci
|
|
|
|
|
return _c
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (_c *MockContainerManager_GetCapacity_Call) Return(_a0 corev1.ResourceList) *MockContainerManager_GetCapacity_Call {
|
|
|
|
|
func (_c *MockContainerManager_GetCapacity_Call) Return(_a0 v1.ResourceList) *MockContainerManager_GetCapacity_Call {
|
|
|
|
|
_c.Call.Return(_a0)
|
|
|
|
|
return _c
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (_c *MockContainerManager_GetCapacity_Call) RunAndReturn(run func(bool) corev1.ResourceList) *MockContainerManager_GetCapacity_Call {
|
|
|
|
|
func (_c *MockContainerManager_GetCapacity_Call) RunAndReturn(run func(bool) v1.ResourceList) *MockContainerManager_GetCapacity_Call {
|
|
|
|
|
_c.Call.Return(run)
|
|
|
|
|
return _c
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// GetDevicePluginResourceCapacity provides a mock function with given fields:
|
|
|
|
|
func (_m *MockContainerManager) GetDevicePluginResourceCapacity() (corev1.ResourceList, corev1.ResourceList, []string) {
|
|
|
|
|
func (_m *MockContainerManager) GetDevicePluginResourceCapacity() (v1.ResourceList, v1.ResourceList, []string) {
|
|
|
|
|
ret := _m.Called()
|
|
|
|
|
|
|
|
|
|
if len(ret) == 0 {
|
|
|
|
|
panic("no return value specified for GetDevicePluginResourceCapacity")
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var r0 corev1.ResourceList
|
|
|
|
|
var r1 corev1.ResourceList
|
|
|
|
|
var r0 v1.ResourceList
|
|
|
|
|
var r1 v1.ResourceList
|
|
|
|
|
var r2 []string
|
|
|
|
|
if rf, ok := ret.Get(0).(func() (corev1.ResourceList, corev1.ResourceList, []string)); ok {
|
|
|
|
|
if rf, ok := ret.Get(0).(func() (v1.ResourceList, v1.ResourceList, []string)); ok {
|
|
|
|
|
return rf()
|
|
|
|
|
}
|
|
|
|
|
if rf, ok := ret.Get(0).(func() corev1.ResourceList); ok {
|
|
|
|
|
if rf, ok := ret.Get(0).(func() v1.ResourceList); ok {
|
|
|
|
|
r0 = rf()
|
|
|
|
|
} else {
|
|
|
|
|
if ret.Get(0) != nil {
|
|
|
|
|
r0 = ret.Get(0).(corev1.ResourceList)
|
|
|
|
|
r0 = ret.Get(0).(v1.ResourceList)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if rf, ok := ret.Get(1).(func() corev1.ResourceList); ok {
|
|
|
|
|
if rf, ok := ret.Get(1).(func() v1.ResourceList); ok {
|
|
|
|
|
r1 = rf()
|
|
|
|
|
} else {
|
|
|
|
|
if ret.Get(1) != nil {
|
|
|
|
|
r1 = ret.Get(1).(corev1.ResourceList)
|
|
|
|
|
r1 = ret.Get(1).(v1.ResourceList)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -405,30 +452,30 @@ func (_c *MockContainerManager_GetDevicePluginResourceCapacity_Call) Run(run fun
|
|
|
|
|
return _c
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (_c *MockContainerManager_GetDevicePluginResourceCapacity_Call) Return(_a0 corev1.ResourceList, _a1 corev1.ResourceList, _a2 []string) *MockContainerManager_GetDevicePluginResourceCapacity_Call {
|
|
|
|
|
func (_c *MockContainerManager_GetDevicePluginResourceCapacity_Call) Return(_a0 v1.ResourceList, _a1 v1.ResourceList, _a2 []string) *MockContainerManager_GetDevicePluginResourceCapacity_Call {
|
|
|
|
|
_c.Call.Return(_a0, _a1, _a2)
|
|
|
|
|
return _c
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (_c *MockContainerManager_GetDevicePluginResourceCapacity_Call) RunAndReturn(run func() (corev1.ResourceList, corev1.ResourceList, []string)) *MockContainerManager_GetDevicePluginResourceCapacity_Call {
|
|
|
|
|
func (_c *MockContainerManager_GetDevicePluginResourceCapacity_Call) RunAndReturn(run func() (v1.ResourceList, v1.ResourceList, []string)) *MockContainerManager_GetDevicePluginResourceCapacity_Call {
|
|
|
|
|
_c.Call.Return(run)
|
|
|
|
|
return _c
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// GetDevices provides a mock function with given fields: podUID, containerName
|
|
|
|
|
func (_m *MockContainerManager) GetDevices(podUID string, containerName string) []*v1.ContainerDevices {
|
|
|
|
|
func (_m *MockContainerManager) GetDevices(podUID string, containerName string) []*podresourcesv1.ContainerDevices {
|
|
|
|
|
ret := _m.Called(podUID, containerName)
|
|
|
|
|
|
|
|
|
|
if len(ret) == 0 {
|
|
|
|
|
panic("no return value specified for GetDevices")
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var r0 []*v1.ContainerDevices
|
|
|
|
|
if rf, ok := ret.Get(0).(func(string, string) []*v1.ContainerDevices); ok {
|
|
|
|
|
var r0 []*podresourcesv1.ContainerDevices
|
|
|
|
|
if rf, ok := ret.Get(0).(func(string, string) []*podresourcesv1.ContainerDevices); ok {
|
|
|
|
|
r0 = rf(podUID, containerName)
|
|
|
|
|
} else {
|
|
|
|
|
if ret.Get(0) != nil {
|
|
|
|
|
r0 = ret.Get(0).([]*v1.ContainerDevices)
|
|
|
|
|
r0 = ret.Get(0).([]*podresourcesv1.ContainerDevices)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -454,30 +501,30 @@ func (_c *MockContainerManager_GetDevices_Call) Run(run func(podUID string, cont
|
|
|
|
|
return _c
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (_c *MockContainerManager_GetDevices_Call) Return(_a0 []*v1.ContainerDevices) *MockContainerManager_GetDevices_Call {
|
|
|
|
|
func (_c *MockContainerManager_GetDevices_Call) Return(_a0 []*podresourcesv1.ContainerDevices) *MockContainerManager_GetDevices_Call {
|
|
|
|
|
_c.Call.Return(_a0)
|
|
|
|
|
return _c
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (_c *MockContainerManager_GetDevices_Call) RunAndReturn(run func(string, string) []*v1.ContainerDevices) *MockContainerManager_GetDevices_Call {
|
|
|
|
|
func (_c *MockContainerManager_GetDevices_Call) RunAndReturn(run func(string, string) []*podresourcesv1.ContainerDevices) *MockContainerManager_GetDevices_Call {
|
|
|
|
|
_c.Call.Return(run)
|
|
|
|
|
return _c
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// GetDynamicResources provides a mock function with given fields: pod, _a1
|
|
|
|
|
func (_m *MockContainerManager) GetDynamicResources(pod *corev1.Pod, _a1 *corev1.Container) []*v1.DynamicResource {
|
|
|
|
|
func (_m *MockContainerManager) GetDynamicResources(pod *v1.Pod, _a1 *v1.Container) []*podresourcesv1.DynamicResource {
|
|
|
|
|
ret := _m.Called(pod, _a1)
|
|
|
|
|
|
|
|
|
|
if len(ret) == 0 {
|
|
|
|
|
panic("no return value specified for GetDynamicResources")
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var r0 []*v1.DynamicResource
|
|
|
|
|
if rf, ok := ret.Get(0).(func(*corev1.Pod, *corev1.Container) []*v1.DynamicResource); ok {
|
|
|
|
|
var r0 []*podresourcesv1.DynamicResource
|
|
|
|
|
if rf, ok := ret.Get(0).(func(*v1.Pod, *v1.Container) []*podresourcesv1.DynamicResource); ok {
|
|
|
|
|
r0 = rf(pod, _a1)
|
|
|
|
|
} else {
|
|
|
|
|
if ret.Get(0) != nil {
|
|
|
|
|
r0 = ret.Get(0).([]*v1.DynamicResource)
|
|
|
|
|
r0 = ret.Get(0).([]*podresourcesv1.DynamicResource)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -490,25 +537,25 @@ type MockContainerManager_GetDynamicResources_Call struct {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// GetDynamicResources is a helper method to define mock.On call
|
|
|
|
|
// - pod *corev1.Pod
|
|
|
|
|
// - _a1 *corev1.Container
|
|
|
|
|
// - pod *v1.Pod
|
|
|
|
|
// - _a1 *v1.Container
|
|
|
|
|
func (_e *MockContainerManager_Expecter) GetDynamicResources(pod interface{}, _a1 interface{}) *MockContainerManager_GetDynamicResources_Call {
|
|
|
|
|
return &MockContainerManager_GetDynamicResources_Call{Call: _e.mock.On("GetDynamicResources", pod, _a1)}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (_c *MockContainerManager_GetDynamicResources_Call) Run(run func(pod *corev1.Pod, _a1 *corev1.Container)) *MockContainerManager_GetDynamicResources_Call {
|
|
|
|
|
func (_c *MockContainerManager_GetDynamicResources_Call) Run(run func(pod *v1.Pod, _a1 *v1.Container)) *MockContainerManager_GetDynamicResources_Call {
|
|
|
|
|
_c.Call.Run(func(args mock.Arguments) {
|
|
|
|
|
run(args[0].(*corev1.Pod), args[1].(*corev1.Container))
|
|
|
|
|
run(args[0].(*v1.Pod), args[1].(*v1.Container))
|
|
|
|
|
})
|
|
|
|
|
return _c
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (_c *MockContainerManager_GetDynamicResources_Call) Return(_a0 []*v1.DynamicResource) *MockContainerManager_GetDynamicResources_Call {
|
|
|
|
|
func (_c *MockContainerManager_GetDynamicResources_Call) Return(_a0 []*podresourcesv1.DynamicResource) *MockContainerManager_GetDynamicResources_Call {
|
|
|
|
|
_c.Call.Return(_a0)
|
|
|
|
|
return _c
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (_c *MockContainerManager_GetDynamicResources_Call) RunAndReturn(run func(*corev1.Pod, *corev1.Container) []*v1.DynamicResource) *MockContainerManager_GetDynamicResources_Call {
|
|
|
|
|
func (_c *MockContainerManager_GetDynamicResources_Call) RunAndReturn(run func(*v1.Pod, *v1.Container) []*podresourcesv1.DynamicResource) *MockContainerManager_GetDynamicResources_Call {
|
|
|
|
|
_c.Call.Return(run)
|
|
|
|
|
return _c
|
|
|
|
|
}
|
|
|
|
|
@@ -561,19 +608,19 @@ func (_c *MockContainerManager_GetHealthCheckers_Call) RunAndReturn(run func() [
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// GetMemory provides a mock function with given fields: podUID, containerName
|
|
|
|
|
func (_m *MockContainerManager) GetMemory(podUID string, containerName string) []*v1.ContainerMemory {
|
|
|
|
|
func (_m *MockContainerManager) GetMemory(podUID string, containerName string) []*podresourcesv1.ContainerMemory {
|
|
|
|
|
ret := _m.Called(podUID, containerName)
|
|
|
|
|
|
|
|
|
|
if len(ret) == 0 {
|
|
|
|
|
panic("no return value specified for GetMemory")
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var r0 []*v1.ContainerMemory
|
|
|
|
|
if rf, ok := ret.Get(0).(func(string, string) []*v1.ContainerMemory); ok {
|
|
|
|
|
var r0 []*podresourcesv1.ContainerMemory
|
|
|
|
|
if rf, ok := ret.Get(0).(func(string, string) []*podresourcesv1.ContainerMemory); ok {
|
|
|
|
|
r0 = rf(podUID, containerName)
|
|
|
|
|
} else {
|
|
|
|
|
if ret.Get(0) != nil {
|
|
|
|
|
r0 = ret.Get(0).([]*v1.ContainerMemory)
|
|
|
|
|
r0 = ret.Get(0).([]*podresourcesv1.ContainerMemory)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -599,12 +646,12 @@ func (_c *MockContainerManager_GetMemory_Call) Run(run func(podUID string, conta
|
|
|
|
|
return _c
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (_c *MockContainerManager_GetMemory_Call) Return(_a0 []*v1.ContainerMemory) *MockContainerManager_GetMemory_Call {
|
|
|
|
|
func (_c *MockContainerManager_GetMemory_Call) Return(_a0 []*podresourcesv1.ContainerMemory) *MockContainerManager_GetMemory_Call {
|
|
|
|
|
_c.Call.Return(_a0)
|
|
|
|
|
return _c
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (_c *MockContainerManager_GetMemory_Call) RunAndReturn(run func(string, string) []*v1.ContainerMemory) *MockContainerManager_GetMemory_Call {
|
|
|
|
|
func (_c *MockContainerManager_GetMemory_Call) RunAndReturn(run func(string, string) []*podresourcesv1.ContainerMemory) *MockContainerManager_GetMemory_Call {
|
|
|
|
|
_c.Call.Return(run)
|
|
|
|
|
return _c
|
|
|
|
|
}
|
|
|
|
|
@@ -657,19 +704,19 @@ func (_c *MockContainerManager_GetMountedSubsystems_Call) RunAndReturn(run func(
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// GetNodeAllocatableAbsolute provides a mock function with given fields:
|
|
|
|
|
func (_m *MockContainerManager) GetNodeAllocatableAbsolute() corev1.ResourceList {
|
|
|
|
|
func (_m *MockContainerManager) GetNodeAllocatableAbsolute() v1.ResourceList {
|
|
|
|
|
ret := _m.Called()
|
|
|
|
|
|
|
|
|
|
if len(ret) == 0 {
|
|
|
|
|
panic("no return value specified for GetNodeAllocatableAbsolute")
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var r0 corev1.ResourceList
|
|
|
|
|
if rf, ok := ret.Get(0).(func() corev1.ResourceList); ok {
|
|
|
|
|
var r0 v1.ResourceList
|
|
|
|
|
if rf, ok := ret.Get(0).(func() v1.ResourceList); ok {
|
|
|
|
|
r0 = rf()
|
|
|
|
|
} else {
|
|
|
|
|
if ret.Get(0) != nil {
|
|
|
|
|
r0 = ret.Get(0).(corev1.ResourceList)
|
|
|
|
|
r0 = ret.Get(0).(v1.ResourceList)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -693,30 +740,30 @@ func (_c *MockContainerManager_GetNodeAllocatableAbsolute_Call) Run(run func())
|
|
|
|
|
return _c
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (_c *MockContainerManager_GetNodeAllocatableAbsolute_Call) Return(_a0 corev1.ResourceList) *MockContainerManager_GetNodeAllocatableAbsolute_Call {
|
|
|
|
|
func (_c *MockContainerManager_GetNodeAllocatableAbsolute_Call) Return(_a0 v1.ResourceList) *MockContainerManager_GetNodeAllocatableAbsolute_Call {
|
|
|
|
|
_c.Call.Return(_a0)
|
|
|
|
|
return _c
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (_c *MockContainerManager_GetNodeAllocatableAbsolute_Call) RunAndReturn(run func() corev1.ResourceList) *MockContainerManager_GetNodeAllocatableAbsolute_Call {
|
|
|
|
|
func (_c *MockContainerManager_GetNodeAllocatableAbsolute_Call) RunAndReturn(run func() v1.ResourceList) *MockContainerManager_GetNodeAllocatableAbsolute_Call {
|
|
|
|
|
_c.Call.Return(run)
|
|
|
|
|
return _c
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// GetNodeAllocatableReservation provides a mock function with given fields:
|
|
|
|
|
func (_m *MockContainerManager) GetNodeAllocatableReservation() corev1.ResourceList {
|
|
|
|
|
func (_m *MockContainerManager) GetNodeAllocatableReservation() v1.ResourceList {
|
|
|
|
|
ret := _m.Called()
|
|
|
|
|
|
|
|
|
|
if len(ret) == 0 {
|
|
|
|
|
panic("no return value specified for GetNodeAllocatableReservation")
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var r0 corev1.ResourceList
|
|
|
|
|
if rf, ok := ret.Get(0).(func() corev1.ResourceList); ok {
|
|
|
|
|
var r0 v1.ResourceList
|
|
|
|
|
if rf, ok := ret.Get(0).(func() v1.ResourceList); ok {
|
|
|
|
|
r0 = rf()
|
|
|
|
|
} else {
|
|
|
|
|
if ret.Get(0) != nil {
|
|
|
|
|
r0 = ret.Get(0).(corev1.ResourceList)
|
|
|
|
|
r0 = ret.Get(0).(v1.ResourceList)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -740,12 +787,12 @@ func (_c *MockContainerManager_GetNodeAllocatableReservation_Call) Run(run func(
|
|
|
|
|
return _c
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (_c *MockContainerManager_GetNodeAllocatableReservation_Call) Return(_a0 corev1.ResourceList) *MockContainerManager_GetNodeAllocatableReservation_Call {
|
|
|
|
|
func (_c *MockContainerManager_GetNodeAllocatableReservation_Call) Return(_a0 v1.ResourceList) *MockContainerManager_GetNodeAllocatableReservation_Call {
|
|
|
|
|
_c.Call.Return(_a0)
|
|
|
|
|
return _c
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (_c *MockContainerManager_GetNodeAllocatableReservation_Call) RunAndReturn(run func() corev1.ResourceList) *MockContainerManager_GetNodeAllocatableReservation_Call {
|
|
|
|
|
func (_c *MockContainerManager_GetNodeAllocatableReservation_Call) RunAndReturn(run func() v1.ResourceList) *MockContainerManager_GetNodeAllocatableReservation_Call {
|
|
|
|
|
_c.Call.Return(run)
|
|
|
|
|
return _c
|
|
|
|
|
}
|
|
|
|
|
@@ -933,7 +980,7 @@ func (_c *MockContainerManager_GetQOSContainersInfo_Call) RunAndReturn(run func(
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// GetResources provides a mock function with given fields: ctx, pod, _a2
|
|
|
|
|
func (_m *MockContainerManager) GetResources(ctx context.Context, pod *corev1.Pod, _a2 *corev1.Container) (*container.RunContainerOptions, error) {
|
|
|
|
|
func (_m *MockContainerManager) GetResources(ctx context.Context, pod *v1.Pod, _a2 *v1.Container) (*container.RunContainerOptions, error) {
|
|
|
|
|
ret := _m.Called(ctx, pod, _a2)
|
|
|
|
|
|
|
|
|
|
if len(ret) == 0 {
|
|
|
|
|
@@ -942,10 +989,10 @@ func (_m *MockContainerManager) GetResources(ctx context.Context, pod *corev1.Po
|
|
|
|
|
|
|
|
|
|
var r0 *container.RunContainerOptions
|
|
|
|
|
var r1 error
|
|
|
|
|
if rf, ok := ret.Get(0).(func(context.Context, *corev1.Pod, *corev1.Container) (*container.RunContainerOptions, error)); ok {
|
|
|
|
|
if rf, ok := ret.Get(0).(func(context.Context, *v1.Pod, *v1.Container) (*container.RunContainerOptions, error)); ok {
|
|
|
|
|
return rf(ctx, pod, _a2)
|
|
|
|
|
}
|
|
|
|
|
if rf, ok := ret.Get(0).(func(context.Context, *corev1.Pod, *corev1.Container) *container.RunContainerOptions); ok {
|
|
|
|
|
if rf, ok := ret.Get(0).(func(context.Context, *v1.Pod, *v1.Container) *container.RunContainerOptions); ok {
|
|
|
|
|
r0 = rf(ctx, pod, _a2)
|
|
|
|
|
} else {
|
|
|
|
|
if ret.Get(0) != nil {
|
|
|
|
|
@@ -953,7 +1000,7 @@ func (_m *MockContainerManager) GetResources(ctx context.Context, pod *corev1.Po
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if rf, ok := ret.Get(1).(func(context.Context, *corev1.Pod, *corev1.Container) error); ok {
|
|
|
|
|
if rf, ok := ret.Get(1).(func(context.Context, *v1.Pod, *v1.Container) error); ok {
|
|
|
|
|
r1 = rf(ctx, pod, _a2)
|
|
|
|
|
} else {
|
|
|
|
|
r1 = ret.Error(1)
|
|
|
|
|
@@ -969,15 +1016,15 @@ type MockContainerManager_GetResources_Call struct {
|
|
|
|
|
|
|
|
|
|
// GetResources is a helper method to define mock.On call
|
|
|
|
|
// - ctx context.Context
|
|
|
|
|
// - pod *corev1.Pod
|
|
|
|
|
// - _a2 *corev1.Container
|
|
|
|
|
// - pod *v1.Pod
|
|
|
|
|
// - _a2 *v1.Container
|
|
|
|
|
func (_e *MockContainerManager_Expecter) GetResources(ctx interface{}, pod interface{}, _a2 interface{}) *MockContainerManager_GetResources_Call {
|
|
|
|
|
return &MockContainerManager_GetResources_Call{Call: _e.mock.On("GetResources", ctx, pod, _a2)}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (_c *MockContainerManager_GetResources_Call) Run(run func(ctx context.Context, pod *corev1.Pod, _a2 *corev1.Container)) *MockContainerManager_GetResources_Call {
|
|
|
|
|
func (_c *MockContainerManager_GetResources_Call) Run(run func(ctx context.Context, pod *v1.Pod, _a2 *v1.Container)) *MockContainerManager_GetResources_Call {
|
|
|
|
|
_c.Call.Run(func(args mock.Arguments) {
|
|
|
|
|
run(args[0].(context.Context), args[1].(*corev1.Pod), args[2].(*corev1.Container))
|
|
|
|
|
run(args[0].(context.Context), args[1].(*v1.Pod), args[2].(*v1.Container))
|
|
|
|
|
})
|
|
|
|
|
return _c
|
|
|
|
|
}
|
|
|
|
|
@@ -987,7 +1034,7 @@ func (_c *MockContainerManager_GetResources_Call) Return(_a0 *container.RunConta
|
|
|
|
|
return _c
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (_c *MockContainerManager_GetResources_Call) RunAndReturn(run func(context.Context, *corev1.Pod, *corev1.Container) (*container.RunContainerOptions, error)) *MockContainerManager_GetResources_Call {
|
|
|
|
|
func (_c *MockContainerManager_GetResources_Call) RunAndReturn(run func(context.Context, *v1.Pod, *v1.Container) (*container.RunContainerOptions, error)) *MockContainerManager_GetResources_Call {
|
|
|
|
|
_c.Call.Return(run)
|
|
|
|
|
return _c
|
|
|
|
|
}
|
|
|
|
|
@@ -1086,6 +1133,52 @@ func (_c *MockContainerManager_NewPodContainerManager_Call) RunAndReturn(run fun
|
|
|
|
|
return _c
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// PodHasExclusiveCPUs provides a mock function with given fields: pod
|
|
|
|
|
func (_m *MockContainerManager) PodHasExclusiveCPUs(pod *v1.Pod) bool {
|
|
|
|
|
ret := _m.Called(pod)
|
|
|
|
|
|
|
|
|
|
if len(ret) == 0 {
|
|
|
|
|
panic("no return value specified for PodHasExclusiveCPUs")
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var r0 bool
|
|
|
|
|
if rf, ok := ret.Get(0).(func(*v1.Pod) bool); ok {
|
|
|
|
|
r0 = rf(pod)
|
|
|
|
|
} else {
|
|
|
|
|
r0 = ret.Get(0).(bool)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return r0
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// MockContainerManager_PodHasExclusiveCPUs_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'PodHasExclusiveCPUs'
|
|
|
|
|
type MockContainerManager_PodHasExclusiveCPUs_Call struct {
|
|
|
|
|
*mock.Call
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// PodHasExclusiveCPUs is a helper method to define mock.On call
|
|
|
|
|
// - pod *v1.Pod
|
|
|
|
|
func (_e *MockContainerManager_Expecter) PodHasExclusiveCPUs(pod interface{}) *MockContainerManager_PodHasExclusiveCPUs_Call {
|
|
|
|
|
return &MockContainerManager_PodHasExclusiveCPUs_Call{Call: _e.mock.On("PodHasExclusiveCPUs", pod)}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (_c *MockContainerManager_PodHasExclusiveCPUs_Call) Run(run func(pod *v1.Pod)) *MockContainerManager_PodHasExclusiveCPUs_Call {
|
|
|
|
|
_c.Call.Run(func(args mock.Arguments) {
|
|
|
|
|
run(args[0].(*v1.Pod))
|
|
|
|
|
})
|
|
|
|
|
return _c
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (_c *MockContainerManager_PodHasExclusiveCPUs_Call) Return(_a0 bool) *MockContainerManager_PodHasExclusiveCPUs_Call {
|
|
|
|
|
_c.Call.Return(_a0)
|
|
|
|
|
return _c
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (_c *MockContainerManager_PodHasExclusiveCPUs_Call) RunAndReturn(run func(*v1.Pod) bool) *MockContainerManager_PodHasExclusiveCPUs_Call {
|
|
|
|
|
_c.Call.Return(run)
|
|
|
|
|
return _c
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// PodMightNeedToUnprepareResources provides a mock function with given fields: UID
|
|
|
|
|
func (_m *MockContainerManager) PodMightNeedToUnprepareResources(UID types.UID) bool {
|
|
|
|
|
ret := _m.Called(UID)
|
|
|
|
|
@@ -1133,7 +1226,7 @@ func (_c *MockContainerManager_PodMightNeedToUnprepareResources_Call) RunAndRetu
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// PrepareDynamicResources provides a mock function with given fields: _a0, _a1
|
|
|
|
|
func (_m *MockContainerManager) PrepareDynamicResources(_a0 context.Context, _a1 *corev1.Pod) error {
|
|
|
|
|
func (_m *MockContainerManager) PrepareDynamicResources(_a0 context.Context, _a1 *v1.Pod) error {
|
|
|
|
|
ret := _m.Called(_a0, _a1)
|
|
|
|
|
|
|
|
|
|
if len(ret) == 0 {
|
|
|
|
|
@@ -1141,7 +1234,7 @@ func (_m *MockContainerManager) PrepareDynamicResources(_a0 context.Context, _a1
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var r0 error
|
|
|
|
|
if rf, ok := ret.Get(0).(func(context.Context, *corev1.Pod) error); ok {
|
|
|
|
|
if rf, ok := ret.Get(0).(func(context.Context, *v1.Pod) error); ok {
|
|
|
|
|
r0 = rf(_a0, _a1)
|
|
|
|
|
} else {
|
|
|
|
|
r0 = ret.Error(0)
|
|
|
|
|
@@ -1157,14 +1250,14 @@ type MockContainerManager_PrepareDynamicResources_Call struct {
|
|
|
|
|
|
|
|
|
|
// PrepareDynamicResources is a helper method to define mock.On call
|
|
|
|
|
// - _a0 context.Context
|
|
|
|
|
// - _a1 *corev1.Pod
|
|
|
|
|
// - _a1 *v1.Pod
|
|
|
|
|
func (_e *MockContainerManager_Expecter) PrepareDynamicResources(_a0 interface{}, _a1 interface{}) *MockContainerManager_PrepareDynamicResources_Call {
|
|
|
|
|
return &MockContainerManager_PrepareDynamicResources_Call{Call: _e.mock.On("PrepareDynamicResources", _a0, _a1)}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (_c *MockContainerManager_PrepareDynamicResources_Call) Run(run func(_a0 context.Context, _a1 *corev1.Pod)) *MockContainerManager_PrepareDynamicResources_Call {
|
|
|
|
|
func (_c *MockContainerManager_PrepareDynamicResources_Call) Run(run func(_a0 context.Context, _a1 *v1.Pod)) *MockContainerManager_PrepareDynamicResources_Call {
|
|
|
|
|
_c.Call.Run(func(args mock.Arguments) {
|
|
|
|
|
run(args[0].(context.Context), args[1].(*corev1.Pod))
|
|
|
|
|
run(args[0].(context.Context), args[1].(*v1.Pod))
|
|
|
|
|
})
|
|
|
|
|
return _c
|
|
|
|
|
}
|
|
|
|
|
@@ -1174,7 +1267,7 @@ func (_c *MockContainerManager_PrepareDynamicResources_Call) Return(_a0 error) *
|
|
|
|
|
return _c
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (_c *MockContainerManager_PrepareDynamicResources_Call) RunAndReturn(run func(context.Context, *corev1.Pod) error) *MockContainerManager_PrepareDynamicResources_Call {
|
|
|
|
|
func (_c *MockContainerManager_PrepareDynamicResources_Call) RunAndReturn(run func(context.Context, *v1.Pod) error) *MockContainerManager_PrepareDynamicResources_Call {
|
|
|
|
|
_c.Call.Return(run)
|
|
|
|
|
return _c
|
|
|
|
|
}
|
|
|
|
|
@@ -1225,7 +1318,7 @@ func (_c *MockContainerManager_ShouldResetExtendedResourceCapacity_Call) RunAndR
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Start provides a mock function with given fields: _a0, _a1, _a2, _a3, _a4, _a5, _a6, _a7
|
|
|
|
|
func (_m *MockContainerManager) Start(_a0 context.Context, _a1 *corev1.Node, _a2 cm.ActivePodsFunc, _a3 cm.GetNodeFunc, _a4 config.SourcesReady, _a5 status.PodStatusProvider, _a6 cri.RuntimeService, _a7 bool) error {
|
|
|
|
|
func (_m *MockContainerManager) Start(_a0 context.Context, _a1 *v1.Node, _a2 cm.ActivePodsFunc, _a3 cm.GetNodeFunc, _a4 config.SourcesReady, _a5 status.PodStatusProvider, _a6 cri.RuntimeService, _a7 bool) error {
|
|
|
|
|
ret := _m.Called(_a0, _a1, _a2, _a3, _a4, _a5, _a6, _a7)
|
|
|
|
|
|
|
|
|
|
if len(ret) == 0 {
|
|
|
|
|
@@ -1233,7 +1326,7 @@ func (_m *MockContainerManager) Start(_a0 context.Context, _a1 *corev1.Node, _a2
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var r0 error
|
|
|
|
|
if rf, ok := ret.Get(0).(func(context.Context, *corev1.Node, cm.ActivePodsFunc, cm.GetNodeFunc, config.SourcesReady, status.PodStatusProvider, cri.RuntimeService, bool) error); ok {
|
|
|
|
|
if rf, ok := ret.Get(0).(func(context.Context, *v1.Node, cm.ActivePodsFunc, cm.GetNodeFunc, config.SourcesReady, status.PodStatusProvider, cri.RuntimeService, bool) error); ok {
|
|
|
|
|
r0 = rf(_a0, _a1, _a2, _a3, _a4, _a5, _a6, _a7)
|
|
|
|
|
} else {
|
|
|
|
|
r0 = ret.Error(0)
|
|
|
|
|
@@ -1249,7 +1342,7 @@ type MockContainerManager_Start_Call struct {
|
|
|
|
|
|
|
|
|
|
// Start is a helper method to define mock.On call
|
|
|
|
|
// - _a0 context.Context
|
|
|
|
|
// - _a1 *corev1.Node
|
|
|
|
|
// - _a1 *v1.Node
|
|
|
|
|
// - _a2 cm.ActivePodsFunc
|
|
|
|
|
// - _a3 cm.GetNodeFunc
|
|
|
|
|
// - _a4 config.SourcesReady
|
|
|
|
|
@@ -1260,9 +1353,9 @@ func (_e *MockContainerManager_Expecter) Start(_a0 interface{}, _a1 interface{},
|
|
|
|
|
return &MockContainerManager_Start_Call{Call: _e.mock.On("Start", _a0, _a1, _a2, _a3, _a4, _a5, _a6, _a7)}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (_c *MockContainerManager_Start_Call) Run(run func(_a0 context.Context, _a1 *corev1.Node, _a2 cm.ActivePodsFunc, _a3 cm.GetNodeFunc, _a4 config.SourcesReady, _a5 status.PodStatusProvider, _a6 cri.RuntimeService, _a7 bool)) *MockContainerManager_Start_Call {
|
|
|
|
|
func (_c *MockContainerManager_Start_Call) Run(run func(_a0 context.Context, _a1 *v1.Node, _a2 cm.ActivePodsFunc, _a3 cm.GetNodeFunc, _a4 config.SourcesReady, _a5 status.PodStatusProvider, _a6 cri.RuntimeService, _a7 bool)) *MockContainerManager_Start_Call {
|
|
|
|
|
_c.Call.Run(func(args mock.Arguments) {
|
|
|
|
|
run(args[0].(context.Context), args[1].(*corev1.Node), args[2].(cm.ActivePodsFunc), args[3].(cm.GetNodeFunc), args[4].(config.SourcesReady), args[5].(status.PodStatusProvider), args[6].(cri.RuntimeService), args[7].(bool))
|
|
|
|
|
run(args[0].(context.Context), args[1].(*v1.Node), args[2].(cm.ActivePodsFunc), args[3].(cm.GetNodeFunc), args[4].(config.SourcesReady), args[5].(status.PodStatusProvider), args[6].(cri.RuntimeService), args[7].(bool))
|
|
|
|
|
})
|
|
|
|
|
return _c
|
|
|
|
|
}
|
|
|
|
|
@@ -1272,7 +1365,7 @@ func (_c *MockContainerManager_Start_Call) Return(_a0 error) *MockContainerManag
|
|
|
|
|
return _c
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (_c *MockContainerManager_Start_Call) RunAndReturn(run func(context.Context, *corev1.Node, cm.ActivePodsFunc, cm.GetNodeFunc, config.SourcesReady, status.PodStatusProvider, cri.RuntimeService, bool) error) *MockContainerManager_Start_Call {
|
|
|
|
|
func (_c *MockContainerManager_Start_Call) RunAndReturn(run func(context.Context, *v1.Node, cm.ActivePodsFunc, cm.GetNodeFunc, config.SourcesReady, status.PodStatusProvider, cri.RuntimeService, bool) error) *MockContainerManager_Start_Call {
|
|
|
|
|
_c.Call.Return(run)
|
|
|
|
|
return _c
|
|
|
|
|
}
|
|
|
|
|
@@ -1323,19 +1416,19 @@ func (_c *MockContainerManager_Status_Call) RunAndReturn(run func() cm.Status) *
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// SystemCgroupsLimit provides a mock function with given fields:
|
|
|
|
|
func (_m *MockContainerManager) SystemCgroupsLimit() corev1.ResourceList {
|
|
|
|
|
func (_m *MockContainerManager) SystemCgroupsLimit() v1.ResourceList {
|
|
|
|
|
ret := _m.Called()
|
|
|
|
|
|
|
|
|
|
if len(ret) == 0 {
|
|
|
|
|
panic("no return value specified for SystemCgroupsLimit")
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var r0 corev1.ResourceList
|
|
|
|
|
if rf, ok := ret.Get(0).(func() corev1.ResourceList); ok {
|
|
|
|
|
var r0 v1.ResourceList
|
|
|
|
|
if rf, ok := ret.Get(0).(func() v1.ResourceList); ok {
|
|
|
|
|
r0 = rf()
|
|
|
|
|
} else {
|
|
|
|
|
if ret.Get(0) != nil {
|
|
|
|
|
r0 = ret.Get(0).(corev1.ResourceList)
|
|
|
|
|
r0 = ret.Get(0).(v1.ResourceList)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -1359,18 +1452,18 @@ func (_c *MockContainerManager_SystemCgroupsLimit_Call) Run(run func()) *MockCon
|
|
|
|
|
return _c
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (_c *MockContainerManager_SystemCgroupsLimit_Call) Return(_a0 corev1.ResourceList) *MockContainerManager_SystemCgroupsLimit_Call {
|
|
|
|
|
func (_c *MockContainerManager_SystemCgroupsLimit_Call) Return(_a0 v1.ResourceList) *MockContainerManager_SystemCgroupsLimit_Call {
|
|
|
|
|
_c.Call.Return(_a0)
|
|
|
|
|
return _c
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (_c *MockContainerManager_SystemCgroupsLimit_Call) RunAndReturn(run func() corev1.ResourceList) *MockContainerManager_SystemCgroupsLimit_Call {
|
|
|
|
|
func (_c *MockContainerManager_SystemCgroupsLimit_Call) RunAndReturn(run func() v1.ResourceList) *MockContainerManager_SystemCgroupsLimit_Call {
|
|
|
|
|
_c.Call.Return(run)
|
|
|
|
|
return _c
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// UnprepareDynamicResources provides a mock function with given fields: _a0, _a1
|
|
|
|
|
func (_m *MockContainerManager) UnprepareDynamicResources(_a0 context.Context, _a1 *corev1.Pod) error {
|
|
|
|
|
func (_m *MockContainerManager) UnprepareDynamicResources(_a0 context.Context, _a1 *v1.Pod) error {
|
|
|
|
|
ret := _m.Called(_a0, _a1)
|
|
|
|
|
|
|
|
|
|
if len(ret) == 0 {
|
|
|
|
|
@@ -1378,7 +1471,7 @@ func (_m *MockContainerManager) UnprepareDynamicResources(_a0 context.Context, _
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var r0 error
|
|
|
|
|
if rf, ok := ret.Get(0).(func(context.Context, *corev1.Pod) error); ok {
|
|
|
|
|
if rf, ok := ret.Get(0).(func(context.Context, *v1.Pod) error); ok {
|
|
|
|
|
r0 = rf(_a0, _a1)
|
|
|
|
|
} else {
|
|
|
|
|
r0 = ret.Error(0)
|
|
|
|
|
@@ -1394,14 +1487,14 @@ type MockContainerManager_UnprepareDynamicResources_Call struct {
|
|
|
|
|
|
|
|
|
|
// UnprepareDynamicResources is a helper method to define mock.On call
|
|
|
|
|
// - _a0 context.Context
|
|
|
|
|
// - _a1 *corev1.Pod
|
|
|
|
|
// - _a1 *v1.Pod
|
|
|
|
|
func (_e *MockContainerManager_Expecter) UnprepareDynamicResources(_a0 interface{}, _a1 interface{}) *MockContainerManager_UnprepareDynamicResources_Call {
|
|
|
|
|
return &MockContainerManager_UnprepareDynamicResources_Call{Call: _e.mock.On("UnprepareDynamicResources", _a0, _a1)}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (_c *MockContainerManager_UnprepareDynamicResources_Call) Run(run func(_a0 context.Context, _a1 *corev1.Pod)) *MockContainerManager_UnprepareDynamicResources_Call {
|
|
|
|
|
func (_c *MockContainerManager_UnprepareDynamicResources_Call) Run(run func(_a0 context.Context, _a1 *v1.Pod)) *MockContainerManager_UnprepareDynamicResources_Call {
|
|
|
|
|
_c.Call.Run(func(args mock.Arguments) {
|
|
|
|
|
run(args[0].(context.Context), args[1].(*corev1.Pod))
|
|
|
|
|
run(args[0].(context.Context), args[1].(*v1.Pod))
|
|
|
|
|
})
|
|
|
|
|
return _c
|
|
|
|
|
}
|
|
|
|
|
@@ -1411,7 +1504,7 @@ func (_c *MockContainerManager_UnprepareDynamicResources_Call) Return(_a0 error)
|
|
|
|
|
return _c
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (_c *MockContainerManager_UnprepareDynamicResources_Call) RunAndReturn(run func(context.Context, *corev1.Pod) error) *MockContainerManager_UnprepareDynamicResources_Call {
|
|
|
|
|
func (_c *MockContainerManager_UnprepareDynamicResources_Call) RunAndReturn(run func(context.Context, *v1.Pod) error) *MockContainerManager_UnprepareDynamicResources_Call {
|
|
|
|
|
_c.Call.Return(run)
|
|
|
|
|
return _c
|
|
|
|
|
}
|
|
|
|
|
@@ -1449,7 +1542,7 @@ func (_c *MockContainerManager_UpdateAllocatedDevices_Call) RunAndReturn(run fun
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// UpdateAllocatedResourcesStatus provides a mock function with given fields: pod, _a1
|
|
|
|
|
func (_m *MockContainerManager) UpdateAllocatedResourcesStatus(pod *corev1.Pod, _a1 *corev1.PodStatus) {
|
|
|
|
|
func (_m *MockContainerManager) UpdateAllocatedResourcesStatus(pod *v1.Pod, _a1 *v1.PodStatus) {
|
|
|
|
|
_m.Called(pod, _a1)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -1459,15 +1552,15 @@ type MockContainerManager_UpdateAllocatedResourcesStatus_Call struct {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// UpdateAllocatedResourcesStatus is a helper method to define mock.On call
|
|
|
|
|
// - pod *corev1.Pod
|
|
|
|
|
// - _a1 *corev1.PodStatus
|
|
|
|
|
// - pod *v1.Pod
|
|
|
|
|
// - _a1 *v1.PodStatus
|
|
|
|
|
func (_e *MockContainerManager_Expecter) UpdateAllocatedResourcesStatus(pod interface{}, _a1 interface{}) *MockContainerManager_UpdateAllocatedResourcesStatus_Call {
|
|
|
|
|
return &MockContainerManager_UpdateAllocatedResourcesStatus_Call{Call: _e.mock.On("UpdateAllocatedResourcesStatus", pod, _a1)}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (_c *MockContainerManager_UpdateAllocatedResourcesStatus_Call) Run(run func(pod *corev1.Pod, _a1 *corev1.PodStatus)) *MockContainerManager_UpdateAllocatedResourcesStatus_Call {
|
|
|
|
|
func (_c *MockContainerManager_UpdateAllocatedResourcesStatus_Call) Run(run func(pod *v1.Pod, _a1 *v1.PodStatus)) *MockContainerManager_UpdateAllocatedResourcesStatus_Call {
|
|
|
|
|
_c.Call.Run(func(args mock.Arguments) {
|
|
|
|
|
run(args[0].(*corev1.Pod), args[1].(*corev1.PodStatus))
|
|
|
|
|
run(args[0].(*v1.Pod), args[1].(*v1.PodStatus))
|
|
|
|
|
})
|
|
|
|
|
return _c
|
|
|
|
|
}
|
|
|
|
|
@@ -1477,7 +1570,7 @@ func (_c *MockContainerManager_UpdateAllocatedResourcesStatus_Call) Return() *Mo
|
|
|
|
|
return _c
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (_c *MockContainerManager_UpdateAllocatedResourcesStatus_Call) RunAndReturn(run func(*corev1.Pod, *corev1.PodStatus)) *MockContainerManager_UpdateAllocatedResourcesStatus_Call {
|
|
|
|
|
func (_c *MockContainerManager_UpdateAllocatedResourcesStatus_Call) RunAndReturn(run func(*v1.Pod, *v1.PodStatus)) *MockContainerManager_UpdateAllocatedResourcesStatus_Call {
|
|
|
|
|
_c.Call.Return(run)
|
|
|
|
|
return _c
|
|
|
|
|
}
|
|
|
|
|
|