k8s.io/kubernetes@v1.29.3/pkg/kubelet/status/testing/mock_pod_status_provider.go (about) 1 /* 2 Copyright The Kubernetes Authors. 3 4 Licensed under the Apache License, Version 2.0 (the "License"); 5 you may not use this file except in compliance with the License. 6 You may obtain a copy of the License at 7 8 http://www.apache.org/licenses/LICENSE-2.0 9 10 Unless required by applicable law or agreed to in writing, software 11 distributed under the License is distributed on an "AS IS" BASIS, 12 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 See the License for the specific language governing permissions and 14 limitations under the License. 15 */ 16 17 // Code generated by MockGen. DO NOT EDIT. 18 // Source: status_manager.go 19 20 // Package testing is a generated GoMock package. 21 package testing 22 23 import ( 24 reflect "reflect" 25 26 gomock "github.com/golang/mock/gomock" 27 v1 "k8s.io/api/core/v1" 28 types "k8s.io/apimachinery/pkg/types" 29 container "k8s.io/kubernetes/pkg/kubelet/container" 30 types0 "k8s.io/kubernetes/pkg/kubelet/types" 31 ) 32 33 // MockPodManager is a mock of PodManager interface. 34 type MockPodManager struct { 35 ctrl *gomock.Controller 36 recorder *MockPodManagerMockRecorder 37 } 38 39 // MockPodManagerMockRecorder is the mock recorder for MockPodManager. 40 type MockPodManagerMockRecorder struct { 41 mock *MockPodManager 42 } 43 44 // NewMockPodManager creates a new mock instance. 45 func NewMockPodManager(ctrl *gomock.Controller) *MockPodManager { 46 mock := &MockPodManager{ctrl: ctrl} 47 mock.recorder = &MockPodManagerMockRecorder{mock} 48 return mock 49 } 50 51 // EXPECT returns an object that allows the caller to indicate expected use. 52 func (m *MockPodManager) EXPECT() *MockPodManagerMockRecorder { 53 return m.recorder 54 } 55 56 // GetMirrorPodByPod mocks base method. 57 func (m *MockPodManager) GetMirrorPodByPod(arg0 *v1.Pod) (*v1.Pod, bool) { 58 m.ctrl.T.Helper() 59 ret := m.ctrl.Call(m, "GetMirrorPodByPod", arg0) 60 ret0, _ := ret[0].(*v1.Pod) 61 ret1, _ := ret[1].(bool) 62 return ret0, ret1 63 } 64 65 // GetMirrorPodByPod indicates an expected call of GetMirrorPodByPod. 66 func (mr *MockPodManagerMockRecorder) GetMirrorPodByPod(arg0 interface{}) *gomock.Call { 67 mr.mock.ctrl.T.Helper() 68 return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetMirrorPodByPod", reflect.TypeOf((*MockPodManager)(nil).GetMirrorPodByPod), arg0) 69 } 70 71 // GetPodByUID mocks base method. 72 func (m *MockPodManager) GetPodByUID(arg0 types.UID) (*v1.Pod, bool) { 73 m.ctrl.T.Helper() 74 ret := m.ctrl.Call(m, "GetPodByUID", arg0) 75 ret0, _ := ret[0].(*v1.Pod) 76 ret1, _ := ret[1].(bool) 77 return ret0, ret1 78 } 79 80 // GetPodByUID indicates an expected call of GetPodByUID. 81 func (mr *MockPodManagerMockRecorder) GetPodByUID(arg0 interface{}) *gomock.Call { 82 mr.mock.ctrl.T.Helper() 83 return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetPodByUID", reflect.TypeOf((*MockPodManager)(nil).GetPodByUID), arg0) 84 } 85 86 // GetUIDTranslations mocks base method. 87 func (m *MockPodManager) GetUIDTranslations() (map[types0.ResolvedPodUID]types0.MirrorPodUID, map[types0.MirrorPodUID]types0.ResolvedPodUID) { 88 m.ctrl.T.Helper() 89 ret := m.ctrl.Call(m, "GetUIDTranslations") 90 ret0, _ := ret[0].(map[types0.ResolvedPodUID]types0.MirrorPodUID) 91 ret1, _ := ret[1].(map[types0.MirrorPodUID]types0.ResolvedPodUID) 92 return ret0, ret1 93 } 94 95 // GetUIDTranslations indicates an expected call of GetUIDTranslations. 96 func (mr *MockPodManagerMockRecorder) GetUIDTranslations() *gomock.Call { 97 mr.mock.ctrl.T.Helper() 98 return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetUIDTranslations", reflect.TypeOf((*MockPodManager)(nil).GetUIDTranslations)) 99 } 100 101 // TranslatePodUID mocks base method. 102 func (m *MockPodManager) TranslatePodUID(uid types.UID) types0.ResolvedPodUID { 103 m.ctrl.T.Helper() 104 ret := m.ctrl.Call(m, "TranslatePodUID", uid) 105 ret0, _ := ret[0].(types0.ResolvedPodUID) 106 return ret0 107 } 108 109 // TranslatePodUID indicates an expected call of TranslatePodUID. 110 func (mr *MockPodManagerMockRecorder) TranslatePodUID(uid interface{}) *gomock.Call { 111 mr.mock.ctrl.T.Helper() 112 return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "TranslatePodUID", reflect.TypeOf((*MockPodManager)(nil).TranslatePodUID), uid) 113 } 114 115 // MockPodStatusProvider is a mock of PodStatusProvider interface. 116 type MockPodStatusProvider struct { 117 ctrl *gomock.Controller 118 recorder *MockPodStatusProviderMockRecorder 119 } 120 121 // MockPodStatusProviderMockRecorder is the mock recorder for MockPodStatusProvider. 122 type MockPodStatusProviderMockRecorder struct { 123 mock *MockPodStatusProvider 124 } 125 126 // NewMockPodStatusProvider creates a new mock instance. 127 func NewMockPodStatusProvider(ctrl *gomock.Controller) *MockPodStatusProvider { 128 mock := &MockPodStatusProvider{ctrl: ctrl} 129 mock.recorder = &MockPodStatusProviderMockRecorder{mock} 130 return mock 131 } 132 133 // EXPECT returns an object that allows the caller to indicate expected use. 134 func (m *MockPodStatusProvider) EXPECT() *MockPodStatusProviderMockRecorder { 135 return m.recorder 136 } 137 138 // GetPodStatus mocks base method. 139 func (m *MockPodStatusProvider) GetPodStatus(uid types.UID) (v1.PodStatus, bool) { 140 m.ctrl.T.Helper() 141 ret := m.ctrl.Call(m, "GetPodStatus", uid) 142 ret0, _ := ret[0].(v1.PodStatus) 143 ret1, _ := ret[1].(bool) 144 return ret0, ret1 145 } 146 147 // GetPodStatus indicates an expected call of GetPodStatus. 148 func (mr *MockPodStatusProviderMockRecorder) GetPodStatus(uid interface{}) *gomock.Call { 149 mr.mock.ctrl.T.Helper() 150 return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetPodStatus", reflect.TypeOf((*MockPodStatusProvider)(nil).GetPodStatus), uid) 151 } 152 153 // MockPodDeletionSafetyProvider is a mock of PodDeletionSafetyProvider interface. 154 type MockPodDeletionSafetyProvider struct { 155 ctrl *gomock.Controller 156 recorder *MockPodDeletionSafetyProviderMockRecorder 157 } 158 159 // MockPodDeletionSafetyProviderMockRecorder is the mock recorder for MockPodDeletionSafetyProvider. 160 type MockPodDeletionSafetyProviderMockRecorder struct { 161 mock *MockPodDeletionSafetyProvider 162 } 163 164 // NewMockPodDeletionSafetyProvider creates a new mock instance. 165 func NewMockPodDeletionSafetyProvider(ctrl *gomock.Controller) *MockPodDeletionSafetyProvider { 166 mock := &MockPodDeletionSafetyProvider{ctrl: ctrl} 167 mock.recorder = &MockPodDeletionSafetyProviderMockRecorder{mock} 168 return mock 169 } 170 171 // EXPECT returns an object that allows the caller to indicate expected use. 172 func (m *MockPodDeletionSafetyProvider) EXPECT() *MockPodDeletionSafetyProviderMockRecorder { 173 return m.recorder 174 } 175 176 // PodCouldHaveRunningContainers mocks base method. 177 func (m *MockPodDeletionSafetyProvider) PodCouldHaveRunningContainers(pod *v1.Pod) bool { 178 m.ctrl.T.Helper() 179 ret := m.ctrl.Call(m, "PodCouldHaveRunningContainers", pod) 180 ret0, _ := ret[0].(bool) 181 return ret0 182 } 183 184 // PodCouldHaveRunningContainers indicates an expected call of PodCouldHaveRunningContainers. 185 func (mr *MockPodDeletionSafetyProviderMockRecorder) PodCouldHaveRunningContainers(pod interface{}) *gomock.Call { 186 mr.mock.ctrl.T.Helper() 187 return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PodCouldHaveRunningContainers", reflect.TypeOf((*MockPodDeletionSafetyProvider)(nil).PodCouldHaveRunningContainers), pod) 188 } 189 190 // MockPodStartupLatencyStateHelper is a mock of PodStartupLatencyStateHelper interface. 191 type MockPodStartupLatencyStateHelper struct { 192 ctrl *gomock.Controller 193 recorder *MockPodStartupLatencyStateHelperMockRecorder 194 } 195 196 // MockPodStartupLatencyStateHelperMockRecorder is the mock recorder for MockPodStartupLatencyStateHelper. 197 type MockPodStartupLatencyStateHelperMockRecorder struct { 198 mock *MockPodStartupLatencyStateHelper 199 } 200 201 // NewMockPodStartupLatencyStateHelper creates a new mock instance. 202 func NewMockPodStartupLatencyStateHelper(ctrl *gomock.Controller) *MockPodStartupLatencyStateHelper { 203 mock := &MockPodStartupLatencyStateHelper{ctrl: ctrl} 204 mock.recorder = &MockPodStartupLatencyStateHelperMockRecorder{mock} 205 return mock 206 } 207 208 // EXPECT returns an object that allows the caller to indicate expected use. 209 func (m *MockPodStartupLatencyStateHelper) EXPECT() *MockPodStartupLatencyStateHelperMockRecorder { 210 return m.recorder 211 } 212 213 // DeletePodStartupState mocks base method. 214 func (m *MockPodStartupLatencyStateHelper) DeletePodStartupState(podUID types.UID) { 215 m.ctrl.T.Helper() 216 m.ctrl.Call(m, "DeletePodStartupState", podUID) 217 } 218 219 // DeletePodStartupState indicates an expected call of DeletePodStartupState. 220 func (mr *MockPodStartupLatencyStateHelperMockRecorder) DeletePodStartupState(podUID interface{}) *gomock.Call { 221 mr.mock.ctrl.T.Helper() 222 return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeletePodStartupState", reflect.TypeOf((*MockPodStartupLatencyStateHelper)(nil).DeletePodStartupState), podUID) 223 } 224 225 // RecordStatusUpdated mocks base method. 226 func (m *MockPodStartupLatencyStateHelper) RecordStatusUpdated(pod *v1.Pod) { 227 m.ctrl.T.Helper() 228 m.ctrl.Call(m, "RecordStatusUpdated", pod) 229 } 230 231 // RecordStatusUpdated indicates an expected call of RecordStatusUpdated. 232 func (mr *MockPodStartupLatencyStateHelperMockRecorder) RecordStatusUpdated(pod interface{}) *gomock.Call { 233 mr.mock.ctrl.T.Helper() 234 return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RecordStatusUpdated", reflect.TypeOf((*MockPodStartupLatencyStateHelper)(nil).RecordStatusUpdated), pod) 235 } 236 237 // MockManager is a mock of Manager interface. 238 type MockManager struct { 239 ctrl *gomock.Controller 240 recorder *MockManagerMockRecorder 241 } 242 243 // MockManagerMockRecorder is the mock recorder for MockManager. 244 type MockManagerMockRecorder struct { 245 mock *MockManager 246 } 247 248 // NewMockManager creates a new mock instance. 249 func NewMockManager(ctrl *gomock.Controller) *MockManager { 250 mock := &MockManager{ctrl: ctrl} 251 mock.recorder = &MockManagerMockRecorder{mock} 252 return mock 253 } 254 255 // EXPECT returns an object that allows the caller to indicate expected use. 256 func (m *MockManager) EXPECT() *MockManagerMockRecorder { 257 return m.recorder 258 } 259 260 // GetContainerResourceAllocation mocks base method. 261 func (m *MockManager) GetContainerResourceAllocation(podUID, containerName string) (v1.ResourceList, bool) { 262 m.ctrl.T.Helper() 263 ret := m.ctrl.Call(m, "GetContainerResourceAllocation", podUID, containerName) 264 ret0, _ := ret[0].(v1.ResourceList) 265 ret1, _ := ret[1].(bool) 266 return ret0, ret1 267 } 268 269 // GetContainerResourceAllocation indicates an expected call of GetContainerResourceAllocation. 270 func (mr *MockManagerMockRecorder) GetContainerResourceAllocation(podUID, containerName interface{}) *gomock.Call { 271 mr.mock.ctrl.T.Helper() 272 return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetContainerResourceAllocation", reflect.TypeOf((*MockManager)(nil).GetContainerResourceAllocation), podUID, containerName) 273 } 274 275 // GetPodResizeStatus mocks base method. 276 func (m *MockManager) GetPodResizeStatus(podUID string) (v1.PodResizeStatus, bool) { 277 m.ctrl.T.Helper() 278 ret := m.ctrl.Call(m, "GetPodResizeStatus", podUID) 279 ret0, _ := ret[0].(v1.PodResizeStatus) 280 ret1, _ := ret[1].(bool) 281 return ret0, ret1 282 } 283 284 // GetPodResizeStatus indicates an expected call of GetPodResizeStatus. 285 func (mr *MockManagerMockRecorder) GetPodResizeStatus(podUID interface{}) *gomock.Call { 286 mr.mock.ctrl.T.Helper() 287 return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetPodResizeStatus", reflect.TypeOf((*MockManager)(nil).GetPodResizeStatus), podUID) 288 } 289 290 // GetPodStatus mocks base method. 291 func (m *MockManager) GetPodStatus(uid types.UID) (v1.PodStatus, bool) { 292 m.ctrl.T.Helper() 293 ret := m.ctrl.Call(m, "GetPodStatus", uid) 294 ret0, _ := ret[0].(v1.PodStatus) 295 ret1, _ := ret[1].(bool) 296 return ret0, ret1 297 } 298 299 // GetPodStatus indicates an expected call of GetPodStatus. 300 func (mr *MockManagerMockRecorder) GetPodStatus(uid interface{}) *gomock.Call { 301 mr.mock.ctrl.T.Helper() 302 return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetPodStatus", reflect.TypeOf((*MockManager)(nil).GetPodStatus), uid) 303 } 304 305 // RemoveOrphanedStatuses mocks base method. 306 func (m *MockManager) RemoveOrphanedStatuses(podUIDs map[types.UID]bool) { 307 m.ctrl.T.Helper() 308 m.ctrl.Call(m, "RemoveOrphanedStatuses", podUIDs) 309 } 310 311 // RemoveOrphanedStatuses indicates an expected call of RemoveOrphanedStatuses. 312 func (mr *MockManagerMockRecorder) RemoveOrphanedStatuses(podUIDs interface{}) *gomock.Call { 313 mr.mock.ctrl.T.Helper() 314 return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RemoveOrphanedStatuses", reflect.TypeOf((*MockManager)(nil).RemoveOrphanedStatuses), podUIDs) 315 } 316 317 // SetContainerReadiness mocks base method. 318 func (m *MockManager) SetContainerReadiness(podUID types.UID, containerID container.ContainerID, ready bool) { 319 m.ctrl.T.Helper() 320 m.ctrl.Call(m, "SetContainerReadiness", podUID, containerID, ready) 321 } 322 323 // SetContainerReadiness indicates an expected call of SetContainerReadiness. 324 func (mr *MockManagerMockRecorder) SetContainerReadiness(podUID, containerID, ready interface{}) *gomock.Call { 325 mr.mock.ctrl.T.Helper() 326 return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetContainerReadiness", reflect.TypeOf((*MockManager)(nil).SetContainerReadiness), podUID, containerID, ready) 327 } 328 329 // SetContainerStartup mocks base method. 330 func (m *MockManager) SetContainerStartup(podUID types.UID, containerID container.ContainerID, started bool) { 331 m.ctrl.T.Helper() 332 m.ctrl.Call(m, "SetContainerStartup", podUID, containerID, started) 333 } 334 335 // SetContainerStartup indicates an expected call of SetContainerStartup. 336 func (mr *MockManagerMockRecorder) SetContainerStartup(podUID, containerID, started interface{}) *gomock.Call { 337 mr.mock.ctrl.T.Helper() 338 return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetContainerStartup", reflect.TypeOf((*MockManager)(nil).SetContainerStartup), podUID, containerID, started) 339 } 340 341 // SetPodAllocation mocks base method. 342 func (m *MockManager) SetPodAllocation(pod *v1.Pod) error { 343 m.ctrl.T.Helper() 344 ret := m.ctrl.Call(m, "SetPodAllocation", pod) 345 ret0, _ := ret[0].(error) 346 return ret0 347 } 348 349 // SetPodAllocation indicates an expected call of SetPodAllocation. 350 func (mr *MockManagerMockRecorder) SetPodAllocation(pod interface{}) *gomock.Call { 351 mr.mock.ctrl.T.Helper() 352 return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetPodAllocation", reflect.TypeOf((*MockManager)(nil).SetPodAllocation), pod) 353 } 354 355 // SetPodResizeStatus mocks base method. 356 func (m *MockManager) SetPodResizeStatus(podUID types.UID, resize v1.PodResizeStatus) error { 357 m.ctrl.T.Helper() 358 ret := m.ctrl.Call(m, "SetPodResizeStatus", podUID, resize) 359 ret0, _ := ret[0].(error) 360 return ret0 361 } 362 363 // SetPodResizeStatus indicates an expected call of SetPodResizeStatus. 364 func (mr *MockManagerMockRecorder) SetPodResizeStatus(podUID, resize interface{}) *gomock.Call { 365 mr.mock.ctrl.T.Helper() 366 return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetPodResizeStatus", reflect.TypeOf((*MockManager)(nil).SetPodResizeStatus), podUID, resize) 367 } 368 369 // SetPodStatus mocks base method. 370 func (m *MockManager) SetPodStatus(pod *v1.Pod, status v1.PodStatus) { 371 m.ctrl.T.Helper() 372 m.ctrl.Call(m, "SetPodStatus", pod, status) 373 } 374 375 // SetPodStatus indicates an expected call of SetPodStatus. 376 func (mr *MockManagerMockRecorder) SetPodStatus(pod, status interface{}) *gomock.Call { 377 mr.mock.ctrl.T.Helper() 378 return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetPodStatus", reflect.TypeOf((*MockManager)(nil).SetPodStatus), pod, status) 379 } 380 381 // Start mocks base method. 382 func (m *MockManager) Start() { 383 m.ctrl.T.Helper() 384 m.ctrl.Call(m, "Start") 385 } 386 387 // Start indicates an expected call of Start. 388 func (mr *MockManagerMockRecorder) Start() *gomock.Call { 389 mr.mock.ctrl.T.Helper() 390 return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Start", reflect.TypeOf((*MockManager)(nil).Start)) 391 } 392 393 // TerminatePod mocks base method. 394 func (m *MockManager) TerminatePod(pod *v1.Pod) { 395 m.ctrl.T.Helper() 396 m.ctrl.Call(m, "TerminatePod", pod) 397 } 398 399 // TerminatePod indicates an expected call of TerminatePod. 400 func (mr *MockManagerMockRecorder) TerminatePod(pod interface{}) *gomock.Call { 401 mr.mock.ctrl.T.Helper() 402 return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "TerminatePod", reflect.TypeOf((*MockManager)(nil).TerminatePod), pod) 403 }