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