github.com/chenbh/concourse/v6@v6.4.2/worker/runtime/libcontainerd/libcontainerdfakes/fake_container.go (about) 1 // Code generated by counterfeiter. DO NOT EDIT. 2 package libcontainerdfakes 3 4 import ( 5 "context" 6 "sync" 7 8 "github.com/containerd/containerd" 9 "github.com/containerd/containerd/cio" 10 "github.com/containerd/containerd/containers" 11 "github.com/gogo/protobuf/types" 12 specs "github.com/opencontainers/runtime-spec/specs-go" 13 ) 14 15 type FakeContainer struct { 16 CheckpointStub func(context.Context, string, ...containerd.CheckpointOpts) (containerd.Image, error) 17 checkpointMutex sync.RWMutex 18 checkpointArgsForCall []struct { 19 arg1 context.Context 20 arg2 string 21 arg3 []containerd.CheckpointOpts 22 } 23 checkpointReturns struct { 24 result1 containerd.Image 25 result2 error 26 } 27 checkpointReturnsOnCall map[int]struct { 28 result1 containerd.Image 29 result2 error 30 } 31 DeleteStub func(context.Context, ...containerd.DeleteOpts) error 32 deleteMutex sync.RWMutex 33 deleteArgsForCall []struct { 34 arg1 context.Context 35 arg2 []containerd.DeleteOpts 36 } 37 deleteReturns struct { 38 result1 error 39 } 40 deleteReturnsOnCall map[int]struct { 41 result1 error 42 } 43 ExtensionsStub func(context.Context) (map[string]types.Any, error) 44 extensionsMutex sync.RWMutex 45 extensionsArgsForCall []struct { 46 arg1 context.Context 47 } 48 extensionsReturns struct { 49 result1 map[string]types.Any 50 result2 error 51 } 52 extensionsReturnsOnCall map[int]struct { 53 result1 map[string]types.Any 54 result2 error 55 } 56 IDStub func() string 57 iDMutex sync.RWMutex 58 iDArgsForCall []struct { 59 } 60 iDReturns struct { 61 result1 string 62 } 63 iDReturnsOnCall map[int]struct { 64 result1 string 65 } 66 ImageStub func(context.Context) (containerd.Image, error) 67 imageMutex sync.RWMutex 68 imageArgsForCall []struct { 69 arg1 context.Context 70 } 71 imageReturns struct { 72 result1 containerd.Image 73 result2 error 74 } 75 imageReturnsOnCall map[int]struct { 76 result1 containerd.Image 77 result2 error 78 } 79 InfoStub func(context.Context, ...containerd.InfoOpts) (containers.Container, error) 80 infoMutex sync.RWMutex 81 infoArgsForCall []struct { 82 arg1 context.Context 83 arg2 []containerd.InfoOpts 84 } 85 infoReturns struct { 86 result1 containers.Container 87 result2 error 88 } 89 infoReturnsOnCall map[int]struct { 90 result1 containers.Container 91 result2 error 92 } 93 LabelsStub func(context.Context) (map[string]string, error) 94 labelsMutex sync.RWMutex 95 labelsArgsForCall []struct { 96 arg1 context.Context 97 } 98 labelsReturns struct { 99 result1 map[string]string 100 result2 error 101 } 102 labelsReturnsOnCall map[int]struct { 103 result1 map[string]string 104 result2 error 105 } 106 NewTaskStub func(context.Context, cio.Creator, ...containerd.NewTaskOpts) (containerd.Task, error) 107 newTaskMutex sync.RWMutex 108 newTaskArgsForCall []struct { 109 arg1 context.Context 110 arg2 cio.Creator 111 arg3 []containerd.NewTaskOpts 112 } 113 newTaskReturns struct { 114 result1 containerd.Task 115 result2 error 116 } 117 newTaskReturnsOnCall map[int]struct { 118 result1 containerd.Task 119 result2 error 120 } 121 SetLabelsStub func(context.Context, map[string]string) (map[string]string, error) 122 setLabelsMutex sync.RWMutex 123 setLabelsArgsForCall []struct { 124 arg1 context.Context 125 arg2 map[string]string 126 } 127 setLabelsReturns struct { 128 result1 map[string]string 129 result2 error 130 } 131 setLabelsReturnsOnCall map[int]struct { 132 result1 map[string]string 133 result2 error 134 } 135 SpecStub func(context.Context) (*specs.Spec, error) 136 specMutex sync.RWMutex 137 specArgsForCall []struct { 138 arg1 context.Context 139 } 140 specReturns struct { 141 result1 *specs.Spec 142 result2 error 143 } 144 specReturnsOnCall map[int]struct { 145 result1 *specs.Spec 146 result2 error 147 } 148 TaskStub func(context.Context, cio.Attach) (containerd.Task, error) 149 taskMutex sync.RWMutex 150 taskArgsForCall []struct { 151 arg1 context.Context 152 arg2 cio.Attach 153 } 154 taskReturns struct { 155 result1 containerd.Task 156 result2 error 157 } 158 taskReturnsOnCall map[int]struct { 159 result1 containerd.Task 160 result2 error 161 } 162 UpdateStub func(context.Context, ...containerd.UpdateContainerOpts) error 163 updateMutex sync.RWMutex 164 updateArgsForCall []struct { 165 arg1 context.Context 166 arg2 []containerd.UpdateContainerOpts 167 } 168 updateReturns struct { 169 result1 error 170 } 171 updateReturnsOnCall map[int]struct { 172 result1 error 173 } 174 invocations map[string][][]interface{} 175 invocationsMutex sync.RWMutex 176 } 177 178 func (fake *FakeContainer) Checkpoint(arg1 context.Context, arg2 string, arg3 ...containerd.CheckpointOpts) (containerd.Image, error) { 179 fake.checkpointMutex.Lock() 180 ret, specificReturn := fake.checkpointReturnsOnCall[len(fake.checkpointArgsForCall)] 181 fake.checkpointArgsForCall = append(fake.checkpointArgsForCall, struct { 182 arg1 context.Context 183 arg2 string 184 arg3 []containerd.CheckpointOpts 185 }{arg1, arg2, arg3}) 186 fake.recordInvocation("Checkpoint", []interface{}{arg1, arg2, arg3}) 187 fake.checkpointMutex.Unlock() 188 if fake.CheckpointStub != nil { 189 return fake.CheckpointStub(arg1, arg2, arg3...) 190 } 191 if specificReturn { 192 return ret.result1, ret.result2 193 } 194 fakeReturns := fake.checkpointReturns 195 return fakeReturns.result1, fakeReturns.result2 196 } 197 198 func (fake *FakeContainer) CheckpointCallCount() int { 199 fake.checkpointMutex.RLock() 200 defer fake.checkpointMutex.RUnlock() 201 return len(fake.checkpointArgsForCall) 202 } 203 204 func (fake *FakeContainer) CheckpointCalls(stub func(context.Context, string, ...containerd.CheckpointOpts) (containerd.Image, error)) { 205 fake.checkpointMutex.Lock() 206 defer fake.checkpointMutex.Unlock() 207 fake.CheckpointStub = stub 208 } 209 210 func (fake *FakeContainer) CheckpointArgsForCall(i int) (context.Context, string, []containerd.CheckpointOpts) { 211 fake.checkpointMutex.RLock() 212 defer fake.checkpointMutex.RUnlock() 213 argsForCall := fake.checkpointArgsForCall[i] 214 return argsForCall.arg1, argsForCall.arg2, argsForCall.arg3 215 } 216 217 func (fake *FakeContainer) CheckpointReturns(result1 containerd.Image, result2 error) { 218 fake.checkpointMutex.Lock() 219 defer fake.checkpointMutex.Unlock() 220 fake.CheckpointStub = nil 221 fake.checkpointReturns = struct { 222 result1 containerd.Image 223 result2 error 224 }{result1, result2} 225 } 226 227 func (fake *FakeContainer) CheckpointReturnsOnCall(i int, result1 containerd.Image, result2 error) { 228 fake.checkpointMutex.Lock() 229 defer fake.checkpointMutex.Unlock() 230 fake.CheckpointStub = nil 231 if fake.checkpointReturnsOnCall == nil { 232 fake.checkpointReturnsOnCall = make(map[int]struct { 233 result1 containerd.Image 234 result2 error 235 }) 236 } 237 fake.checkpointReturnsOnCall[i] = struct { 238 result1 containerd.Image 239 result2 error 240 }{result1, result2} 241 } 242 243 func (fake *FakeContainer) Delete(arg1 context.Context, arg2 ...containerd.DeleteOpts) error { 244 fake.deleteMutex.Lock() 245 ret, specificReturn := fake.deleteReturnsOnCall[len(fake.deleteArgsForCall)] 246 fake.deleteArgsForCall = append(fake.deleteArgsForCall, struct { 247 arg1 context.Context 248 arg2 []containerd.DeleteOpts 249 }{arg1, arg2}) 250 fake.recordInvocation("Delete", []interface{}{arg1, arg2}) 251 fake.deleteMutex.Unlock() 252 if fake.DeleteStub != nil { 253 return fake.DeleteStub(arg1, arg2...) 254 } 255 if specificReturn { 256 return ret.result1 257 } 258 fakeReturns := fake.deleteReturns 259 return fakeReturns.result1 260 } 261 262 func (fake *FakeContainer) DeleteCallCount() int { 263 fake.deleteMutex.RLock() 264 defer fake.deleteMutex.RUnlock() 265 return len(fake.deleteArgsForCall) 266 } 267 268 func (fake *FakeContainer) DeleteCalls(stub func(context.Context, ...containerd.DeleteOpts) error) { 269 fake.deleteMutex.Lock() 270 defer fake.deleteMutex.Unlock() 271 fake.DeleteStub = stub 272 } 273 274 func (fake *FakeContainer) DeleteArgsForCall(i int) (context.Context, []containerd.DeleteOpts) { 275 fake.deleteMutex.RLock() 276 defer fake.deleteMutex.RUnlock() 277 argsForCall := fake.deleteArgsForCall[i] 278 return argsForCall.arg1, argsForCall.arg2 279 } 280 281 func (fake *FakeContainer) DeleteReturns(result1 error) { 282 fake.deleteMutex.Lock() 283 defer fake.deleteMutex.Unlock() 284 fake.DeleteStub = nil 285 fake.deleteReturns = struct { 286 result1 error 287 }{result1} 288 } 289 290 func (fake *FakeContainer) DeleteReturnsOnCall(i int, result1 error) { 291 fake.deleteMutex.Lock() 292 defer fake.deleteMutex.Unlock() 293 fake.DeleteStub = nil 294 if fake.deleteReturnsOnCall == nil { 295 fake.deleteReturnsOnCall = make(map[int]struct { 296 result1 error 297 }) 298 } 299 fake.deleteReturnsOnCall[i] = struct { 300 result1 error 301 }{result1} 302 } 303 304 func (fake *FakeContainer) Extensions(arg1 context.Context) (map[string]types.Any, error) { 305 fake.extensionsMutex.Lock() 306 ret, specificReturn := fake.extensionsReturnsOnCall[len(fake.extensionsArgsForCall)] 307 fake.extensionsArgsForCall = append(fake.extensionsArgsForCall, struct { 308 arg1 context.Context 309 }{arg1}) 310 fake.recordInvocation("Extensions", []interface{}{arg1}) 311 fake.extensionsMutex.Unlock() 312 if fake.ExtensionsStub != nil { 313 return fake.ExtensionsStub(arg1) 314 } 315 if specificReturn { 316 return ret.result1, ret.result2 317 } 318 fakeReturns := fake.extensionsReturns 319 return fakeReturns.result1, fakeReturns.result2 320 } 321 322 func (fake *FakeContainer) ExtensionsCallCount() int { 323 fake.extensionsMutex.RLock() 324 defer fake.extensionsMutex.RUnlock() 325 return len(fake.extensionsArgsForCall) 326 } 327 328 func (fake *FakeContainer) ExtensionsCalls(stub func(context.Context) (map[string]types.Any, error)) { 329 fake.extensionsMutex.Lock() 330 defer fake.extensionsMutex.Unlock() 331 fake.ExtensionsStub = stub 332 } 333 334 func (fake *FakeContainer) ExtensionsArgsForCall(i int) context.Context { 335 fake.extensionsMutex.RLock() 336 defer fake.extensionsMutex.RUnlock() 337 argsForCall := fake.extensionsArgsForCall[i] 338 return argsForCall.arg1 339 } 340 341 func (fake *FakeContainer) ExtensionsReturns(result1 map[string]types.Any, result2 error) { 342 fake.extensionsMutex.Lock() 343 defer fake.extensionsMutex.Unlock() 344 fake.ExtensionsStub = nil 345 fake.extensionsReturns = struct { 346 result1 map[string]types.Any 347 result2 error 348 }{result1, result2} 349 } 350 351 func (fake *FakeContainer) ExtensionsReturnsOnCall(i int, result1 map[string]types.Any, result2 error) { 352 fake.extensionsMutex.Lock() 353 defer fake.extensionsMutex.Unlock() 354 fake.ExtensionsStub = nil 355 if fake.extensionsReturnsOnCall == nil { 356 fake.extensionsReturnsOnCall = make(map[int]struct { 357 result1 map[string]types.Any 358 result2 error 359 }) 360 } 361 fake.extensionsReturnsOnCall[i] = struct { 362 result1 map[string]types.Any 363 result2 error 364 }{result1, result2} 365 } 366 367 func (fake *FakeContainer) ID() string { 368 fake.iDMutex.Lock() 369 ret, specificReturn := fake.iDReturnsOnCall[len(fake.iDArgsForCall)] 370 fake.iDArgsForCall = append(fake.iDArgsForCall, struct { 371 }{}) 372 fake.recordInvocation("ID", []interface{}{}) 373 fake.iDMutex.Unlock() 374 if fake.IDStub != nil { 375 return fake.IDStub() 376 } 377 if specificReturn { 378 return ret.result1 379 } 380 fakeReturns := fake.iDReturns 381 return fakeReturns.result1 382 } 383 384 func (fake *FakeContainer) IDCallCount() int { 385 fake.iDMutex.RLock() 386 defer fake.iDMutex.RUnlock() 387 return len(fake.iDArgsForCall) 388 } 389 390 func (fake *FakeContainer) IDCalls(stub func() string) { 391 fake.iDMutex.Lock() 392 defer fake.iDMutex.Unlock() 393 fake.IDStub = stub 394 } 395 396 func (fake *FakeContainer) IDReturns(result1 string) { 397 fake.iDMutex.Lock() 398 defer fake.iDMutex.Unlock() 399 fake.IDStub = nil 400 fake.iDReturns = struct { 401 result1 string 402 }{result1} 403 } 404 405 func (fake *FakeContainer) IDReturnsOnCall(i int, result1 string) { 406 fake.iDMutex.Lock() 407 defer fake.iDMutex.Unlock() 408 fake.IDStub = nil 409 if fake.iDReturnsOnCall == nil { 410 fake.iDReturnsOnCall = make(map[int]struct { 411 result1 string 412 }) 413 } 414 fake.iDReturnsOnCall[i] = struct { 415 result1 string 416 }{result1} 417 } 418 419 func (fake *FakeContainer) Image(arg1 context.Context) (containerd.Image, error) { 420 fake.imageMutex.Lock() 421 ret, specificReturn := fake.imageReturnsOnCall[len(fake.imageArgsForCall)] 422 fake.imageArgsForCall = append(fake.imageArgsForCall, struct { 423 arg1 context.Context 424 }{arg1}) 425 fake.recordInvocation("Image", []interface{}{arg1}) 426 fake.imageMutex.Unlock() 427 if fake.ImageStub != nil { 428 return fake.ImageStub(arg1) 429 } 430 if specificReturn { 431 return ret.result1, ret.result2 432 } 433 fakeReturns := fake.imageReturns 434 return fakeReturns.result1, fakeReturns.result2 435 } 436 437 func (fake *FakeContainer) ImageCallCount() int { 438 fake.imageMutex.RLock() 439 defer fake.imageMutex.RUnlock() 440 return len(fake.imageArgsForCall) 441 } 442 443 func (fake *FakeContainer) ImageCalls(stub func(context.Context) (containerd.Image, error)) { 444 fake.imageMutex.Lock() 445 defer fake.imageMutex.Unlock() 446 fake.ImageStub = stub 447 } 448 449 func (fake *FakeContainer) ImageArgsForCall(i int) context.Context { 450 fake.imageMutex.RLock() 451 defer fake.imageMutex.RUnlock() 452 argsForCall := fake.imageArgsForCall[i] 453 return argsForCall.arg1 454 } 455 456 func (fake *FakeContainer) ImageReturns(result1 containerd.Image, result2 error) { 457 fake.imageMutex.Lock() 458 defer fake.imageMutex.Unlock() 459 fake.ImageStub = nil 460 fake.imageReturns = struct { 461 result1 containerd.Image 462 result2 error 463 }{result1, result2} 464 } 465 466 func (fake *FakeContainer) ImageReturnsOnCall(i int, result1 containerd.Image, result2 error) { 467 fake.imageMutex.Lock() 468 defer fake.imageMutex.Unlock() 469 fake.ImageStub = nil 470 if fake.imageReturnsOnCall == nil { 471 fake.imageReturnsOnCall = make(map[int]struct { 472 result1 containerd.Image 473 result2 error 474 }) 475 } 476 fake.imageReturnsOnCall[i] = struct { 477 result1 containerd.Image 478 result2 error 479 }{result1, result2} 480 } 481 482 func (fake *FakeContainer) Info(arg1 context.Context, arg2 ...containerd.InfoOpts) (containers.Container, error) { 483 fake.infoMutex.Lock() 484 ret, specificReturn := fake.infoReturnsOnCall[len(fake.infoArgsForCall)] 485 fake.infoArgsForCall = append(fake.infoArgsForCall, struct { 486 arg1 context.Context 487 arg2 []containerd.InfoOpts 488 }{arg1, arg2}) 489 fake.recordInvocation("Info", []interface{}{arg1, arg2}) 490 fake.infoMutex.Unlock() 491 if fake.InfoStub != nil { 492 return fake.InfoStub(arg1, arg2...) 493 } 494 if specificReturn { 495 return ret.result1, ret.result2 496 } 497 fakeReturns := fake.infoReturns 498 return fakeReturns.result1, fakeReturns.result2 499 } 500 501 func (fake *FakeContainer) InfoCallCount() int { 502 fake.infoMutex.RLock() 503 defer fake.infoMutex.RUnlock() 504 return len(fake.infoArgsForCall) 505 } 506 507 func (fake *FakeContainer) InfoCalls(stub func(context.Context, ...containerd.InfoOpts) (containers.Container, error)) { 508 fake.infoMutex.Lock() 509 defer fake.infoMutex.Unlock() 510 fake.InfoStub = stub 511 } 512 513 func (fake *FakeContainer) InfoArgsForCall(i int) (context.Context, []containerd.InfoOpts) { 514 fake.infoMutex.RLock() 515 defer fake.infoMutex.RUnlock() 516 argsForCall := fake.infoArgsForCall[i] 517 return argsForCall.arg1, argsForCall.arg2 518 } 519 520 func (fake *FakeContainer) InfoReturns(result1 containers.Container, result2 error) { 521 fake.infoMutex.Lock() 522 defer fake.infoMutex.Unlock() 523 fake.InfoStub = nil 524 fake.infoReturns = struct { 525 result1 containers.Container 526 result2 error 527 }{result1, result2} 528 } 529 530 func (fake *FakeContainer) InfoReturnsOnCall(i int, result1 containers.Container, result2 error) { 531 fake.infoMutex.Lock() 532 defer fake.infoMutex.Unlock() 533 fake.InfoStub = nil 534 if fake.infoReturnsOnCall == nil { 535 fake.infoReturnsOnCall = make(map[int]struct { 536 result1 containers.Container 537 result2 error 538 }) 539 } 540 fake.infoReturnsOnCall[i] = struct { 541 result1 containers.Container 542 result2 error 543 }{result1, result2} 544 } 545 546 func (fake *FakeContainer) Labels(arg1 context.Context) (map[string]string, error) { 547 fake.labelsMutex.Lock() 548 ret, specificReturn := fake.labelsReturnsOnCall[len(fake.labelsArgsForCall)] 549 fake.labelsArgsForCall = append(fake.labelsArgsForCall, struct { 550 arg1 context.Context 551 }{arg1}) 552 fake.recordInvocation("Labels", []interface{}{arg1}) 553 fake.labelsMutex.Unlock() 554 if fake.LabelsStub != nil { 555 return fake.LabelsStub(arg1) 556 } 557 if specificReturn { 558 return ret.result1, ret.result2 559 } 560 fakeReturns := fake.labelsReturns 561 return fakeReturns.result1, fakeReturns.result2 562 } 563 564 func (fake *FakeContainer) LabelsCallCount() int { 565 fake.labelsMutex.RLock() 566 defer fake.labelsMutex.RUnlock() 567 return len(fake.labelsArgsForCall) 568 } 569 570 func (fake *FakeContainer) LabelsCalls(stub func(context.Context) (map[string]string, error)) { 571 fake.labelsMutex.Lock() 572 defer fake.labelsMutex.Unlock() 573 fake.LabelsStub = stub 574 } 575 576 func (fake *FakeContainer) LabelsArgsForCall(i int) context.Context { 577 fake.labelsMutex.RLock() 578 defer fake.labelsMutex.RUnlock() 579 argsForCall := fake.labelsArgsForCall[i] 580 return argsForCall.arg1 581 } 582 583 func (fake *FakeContainer) LabelsReturns(result1 map[string]string, result2 error) { 584 fake.labelsMutex.Lock() 585 defer fake.labelsMutex.Unlock() 586 fake.LabelsStub = nil 587 fake.labelsReturns = struct { 588 result1 map[string]string 589 result2 error 590 }{result1, result2} 591 } 592 593 func (fake *FakeContainer) LabelsReturnsOnCall(i int, result1 map[string]string, result2 error) { 594 fake.labelsMutex.Lock() 595 defer fake.labelsMutex.Unlock() 596 fake.LabelsStub = nil 597 if fake.labelsReturnsOnCall == nil { 598 fake.labelsReturnsOnCall = make(map[int]struct { 599 result1 map[string]string 600 result2 error 601 }) 602 } 603 fake.labelsReturnsOnCall[i] = struct { 604 result1 map[string]string 605 result2 error 606 }{result1, result2} 607 } 608 609 func (fake *FakeContainer) NewTask(arg1 context.Context, arg2 cio.Creator, arg3 ...containerd.NewTaskOpts) (containerd.Task, error) { 610 fake.newTaskMutex.Lock() 611 ret, specificReturn := fake.newTaskReturnsOnCall[len(fake.newTaskArgsForCall)] 612 fake.newTaskArgsForCall = append(fake.newTaskArgsForCall, struct { 613 arg1 context.Context 614 arg2 cio.Creator 615 arg3 []containerd.NewTaskOpts 616 }{arg1, arg2, arg3}) 617 fake.recordInvocation("NewTask", []interface{}{arg1, arg2, arg3}) 618 fake.newTaskMutex.Unlock() 619 if fake.NewTaskStub != nil { 620 return fake.NewTaskStub(arg1, arg2, arg3...) 621 } 622 if specificReturn { 623 return ret.result1, ret.result2 624 } 625 fakeReturns := fake.newTaskReturns 626 return fakeReturns.result1, fakeReturns.result2 627 } 628 629 func (fake *FakeContainer) NewTaskCallCount() int { 630 fake.newTaskMutex.RLock() 631 defer fake.newTaskMutex.RUnlock() 632 return len(fake.newTaskArgsForCall) 633 } 634 635 func (fake *FakeContainer) NewTaskCalls(stub func(context.Context, cio.Creator, ...containerd.NewTaskOpts) (containerd.Task, error)) { 636 fake.newTaskMutex.Lock() 637 defer fake.newTaskMutex.Unlock() 638 fake.NewTaskStub = stub 639 } 640 641 func (fake *FakeContainer) NewTaskArgsForCall(i int) (context.Context, cio.Creator, []containerd.NewTaskOpts) { 642 fake.newTaskMutex.RLock() 643 defer fake.newTaskMutex.RUnlock() 644 argsForCall := fake.newTaskArgsForCall[i] 645 return argsForCall.arg1, argsForCall.arg2, argsForCall.arg3 646 } 647 648 func (fake *FakeContainer) NewTaskReturns(result1 containerd.Task, result2 error) { 649 fake.newTaskMutex.Lock() 650 defer fake.newTaskMutex.Unlock() 651 fake.NewTaskStub = nil 652 fake.newTaskReturns = struct { 653 result1 containerd.Task 654 result2 error 655 }{result1, result2} 656 } 657 658 func (fake *FakeContainer) NewTaskReturnsOnCall(i int, result1 containerd.Task, result2 error) { 659 fake.newTaskMutex.Lock() 660 defer fake.newTaskMutex.Unlock() 661 fake.NewTaskStub = nil 662 if fake.newTaskReturnsOnCall == nil { 663 fake.newTaskReturnsOnCall = make(map[int]struct { 664 result1 containerd.Task 665 result2 error 666 }) 667 } 668 fake.newTaskReturnsOnCall[i] = struct { 669 result1 containerd.Task 670 result2 error 671 }{result1, result2} 672 } 673 674 func (fake *FakeContainer) SetLabels(arg1 context.Context, arg2 map[string]string) (map[string]string, error) { 675 fake.setLabelsMutex.Lock() 676 ret, specificReturn := fake.setLabelsReturnsOnCall[len(fake.setLabelsArgsForCall)] 677 fake.setLabelsArgsForCall = append(fake.setLabelsArgsForCall, struct { 678 arg1 context.Context 679 arg2 map[string]string 680 }{arg1, arg2}) 681 fake.recordInvocation("SetLabels", []interface{}{arg1, arg2}) 682 fake.setLabelsMutex.Unlock() 683 if fake.SetLabelsStub != nil { 684 return fake.SetLabelsStub(arg1, arg2) 685 } 686 if specificReturn { 687 return ret.result1, ret.result2 688 } 689 fakeReturns := fake.setLabelsReturns 690 return fakeReturns.result1, fakeReturns.result2 691 } 692 693 func (fake *FakeContainer) SetLabelsCallCount() int { 694 fake.setLabelsMutex.RLock() 695 defer fake.setLabelsMutex.RUnlock() 696 return len(fake.setLabelsArgsForCall) 697 } 698 699 func (fake *FakeContainer) SetLabelsCalls(stub func(context.Context, map[string]string) (map[string]string, error)) { 700 fake.setLabelsMutex.Lock() 701 defer fake.setLabelsMutex.Unlock() 702 fake.SetLabelsStub = stub 703 } 704 705 func (fake *FakeContainer) SetLabelsArgsForCall(i int) (context.Context, map[string]string) { 706 fake.setLabelsMutex.RLock() 707 defer fake.setLabelsMutex.RUnlock() 708 argsForCall := fake.setLabelsArgsForCall[i] 709 return argsForCall.arg1, argsForCall.arg2 710 } 711 712 func (fake *FakeContainer) SetLabelsReturns(result1 map[string]string, result2 error) { 713 fake.setLabelsMutex.Lock() 714 defer fake.setLabelsMutex.Unlock() 715 fake.SetLabelsStub = nil 716 fake.setLabelsReturns = struct { 717 result1 map[string]string 718 result2 error 719 }{result1, result2} 720 } 721 722 func (fake *FakeContainer) SetLabelsReturnsOnCall(i int, result1 map[string]string, result2 error) { 723 fake.setLabelsMutex.Lock() 724 defer fake.setLabelsMutex.Unlock() 725 fake.SetLabelsStub = nil 726 if fake.setLabelsReturnsOnCall == nil { 727 fake.setLabelsReturnsOnCall = make(map[int]struct { 728 result1 map[string]string 729 result2 error 730 }) 731 } 732 fake.setLabelsReturnsOnCall[i] = struct { 733 result1 map[string]string 734 result2 error 735 }{result1, result2} 736 } 737 738 func (fake *FakeContainer) Spec(arg1 context.Context) (*specs.Spec, error) { 739 fake.specMutex.Lock() 740 ret, specificReturn := fake.specReturnsOnCall[len(fake.specArgsForCall)] 741 fake.specArgsForCall = append(fake.specArgsForCall, struct { 742 arg1 context.Context 743 }{arg1}) 744 fake.recordInvocation("Spec", []interface{}{arg1}) 745 fake.specMutex.Unlock() 746 if fake.SpecStub != nil { 747 return fake.SpecStub(arg1) 748 } 749 if specificReturn { 750 return ret.result1, ret.result2 751 } 752 fakeReturns := fake.specReturns 753 return fakeReturns.result1, fakeReturns.result2 754 } 755 756 func (fake *FakeContainer) SpecCallCount() int { 757 fake.specMutex.RLock() 758 defer fake.specMutex.RUnlock() 759 return len(fake.specArgsForCall) 760 } 761 762 func (fake *FakeContainer) SpecCalls(stub func(context.Context) (*specs.Spec, error)) { 763 fake.specMutex.Lock() 764 defer fake.specMutex.Unlock() 765 fake.SpecStub = stub 766 } 767 768 func (fake *FakeContainer) SpecArgsForCall(i int) context.Context { 769 fake.specMutex.RLock() 770 defer fake.specMutex.RUnlock() 771 argsForCall := fake.specArgsForCall[i] 772 return argsForCall.arg1 773 } 774 775 func (fake *FakeContainer) SpecReturns(result1 *specs.Spec, result2 error) { 776 fake.specMutex.Lock() 777 defer fake.specMutex.Unlock() 778 fake.SpecStub = nil 779 fake.specReturns = struct { 780 result1 *specs.Spec 781 result2 error 782 }{result1, result2} 783 } 784 785 func (fake *FakeContainer) SpecReturnsOnCall(i int, result1 *specs.Spec, result2 error) { 786 fake.specMutex.Lock() 787 defer fake.specMutex.Unlock() 788 fake.SpecStub = nil 789 if fake.specReturnsOnCall == nil { 790 fake.specReturnsOnCall = make(map[int]struct { 791 result1 *specs.Spec 792 result2 error 793 }) 794 } 795 fake.specReturnsOnCall[i] = struct { 796 result1 *specs.Spec 797 result2 error 798 }{result1, result2} 799 } 800 801 func (fake *FakeContainer) Task(arg1 context.Context, arg2 cio.Attach) (containerd.Task, error) { 802 fake.taskMutex.Lock() 803 ret, specificReturn := fake.taskReturnsOnCall[len(fake.taskArgsForCall)] 804 fake.taskArgsForCall = append(fake.taskArgsForCall, struct { 805 arg1 context.Context 806 arg2 cio.Attach 807 }{arg1, arg2}) 808 fake.recordInvocation("Task", []interface{}{arg1, arg2}) 809 fake.taskMutex.Unlock() 810 if fake.TaskStub != nil { 811 return fake.TaskStub(arg1, arg2) 812 } 813 if specificReturn { 814 return ret.result1, ret.result2 815 } 816 fakeReturns := fake.taskReturns 817 return fakeReturns.result1, fakeReturns.result2 818 } 819 820 func (fake *FakeContainer) TaskCallCount() int { 821 fake.taskMutex.RLock() 822 defer fake.taskMutex.RUnlock() 823 return len(fake.taskArgsForCall) 824 } 825 826 func (fake *FakeContainer) TaskCalls(stub func(context.Context, cio.Attach) (containerd.Task, error)) { 827 fake.taskMutex.Lock() 828 defer fake.taskMutex.Unlock() 829 fake.TaskStub = stub 830 } 831 832 func (fake *FakeContainer) TaskArgsForCall(i int) (context.Context, cio.Attach) { 833 fake.taskMutex.RLock() 834 defer fake.taskMutex.RUnlock() 835 argsForCall := fake.taskArgsForCall[i] 836 return argsForCall.arg1, argsForCall.arg2 837 } 838 839 func (fake *FakeContainer) TaskReturns(result1 containerd.Task, result2 error) { 840 fake.taskMutex.Lock() 841 defer fake.taskMutex.Unlock() 842 fake.TaskStub = nil 843 fake.taskReturns = struct { 844 result1 containerd.Task 845 result2 error 846 }{result1, result2} 847 } 848 849 func (fake *FakeContainer) TaskReturnsOnCall(i int, result1 containerd.Task, result2 error) { 850 fake.taskMutex.Lock() 851 defer fake.taskMutex.Unlock() 852 fake.TaskStub = nil 853 if fake.taskReturnsOnCall == nil { 854 fake.taskReturnsOnCall = make(map[int]struct { 855 result1 containerd.Task 856 result2 error 857 }) 858 } 859 fake.taskReturnsOnCall[i] = struct { 860 result1 containerd.Task 861 result2 error 862 }{result1, result2} 863 } 864 865 func (fake *FakeContainer) Update(arg1 context.Context, arg2 ...containerd.UpdateContainerOpts) error { 866 fake.updateMutex.Lock() 867 ret, specificReturn := fake.updateReturnsOnCall[len(fake.updateArgsForCall)] 868 fake.updateArgsForCall = append(fake.updateArgsForCall, struct { 869 arg1 context.Context 870 arg2 []containerd.UpdateContainerOpts 871 }{arg1, arg2}) 872 fake.recordInvocation("Update", []interface{}{arg1, arg2}) 873 fake.updateMutex.Unlock() 874 if fake.UpdateStub != nil { 875 return fake.UpdateStub(arg1, arg2...) 876 } 877 if specificReturn { 878 return ret.result1 879 } 880 fakeReturns := fake.updateReturns 881 return fakeReturns.result1 882 } 883 884 func (fake *FakeContainer) UpdateCallCount() int { 885 fake.updateMutex.RLock() 886 defer fake.updateMutex.RUnlock() 887 return len(fake.updateArgsForCall) 888 } 889 890 func (fake *FakeContainer) UpdateCalls(stub func(context.Context, ...containerd.UpdateContainerOpts) error) { 891 fake.updateMutex.Lock() 892 defer fake.updateMutex.Unlock() 893 fake.UpdateStub = stub 894 } 895 896 func (fake *FakeContainer) UpdateArgsForCall(i int) (context.Context, []containerd.UpdateContainerOpts) { 897 fake.updateMutex.RLock() 898 defer fake.updateMutex.RUnlock() 899 argsForCall := fake.updateArgsForCall[i] 900 return argsForCall.arg1, argsForCall.arg2 901 } 902 903 func (fake *FakeContainer) UpdateReturns(result1 error) { 904 fake.updateMutex.Lock() 905 defer fake.updateMutex.Unlock() 906 fake.UpdateStub = nil 907 fake.updateReturns = struct { 908 result1 error 909 }{result1} 910 } 911 912 func (fake *FakeContainer) UpdateReturnsOnCall(i int, result1 error) { 913 fake.updateMutex.Lock() 914 defer fake.updateMutex.Unlock() 915 fake.UpdateStub = nil 916 if fake.updateReturnsOnCall == nil { 917 fake.updateReturnsOnCall = make(map[int]struct { 918 result1 error 919 }) 920 } 921 fake.updateReturnsOnCall[i] = struct { 922 result1 error 923 }{result1} 924 } 925 926 func (fake *FakeContainer) Invocations() map[string][][]interface{} { 927 fake.invocationsMutex.RLock() 928 defer fake.invocationsMutex.RUnlock() 929 fake.checkpointMutex.RLock() 930 defer fake.checkpointMutex.RUnlock() 931 fake.deleteMutex.RLock() 932 defer fake.deleteMutex.RUnlock() 933 fake.extensionsMutex.RLock() 934 defer fake.extensionsMutex.RUnlock() 935 fake.iDMutex.RLock() 936 defer fake.iDMutex.RUnlock() 937 fake.imageMutex.RLock() 938 defer fake.imageMutex.RUnlock() 939 fake.infoMutex.RLock() 940 defer fake.infoMutex.RUnlock() 941 fake.labelsMutex.RLock() 942 defer fake.labelsMutex.RUnlock() 943 fake.newTaskMutex.RLock() 944 defer fake.newTaskMutex.RUnlock() 945 fake.setLabelsMutex.RLock() 946 defer fake.setLabelsMutex.RUnlock() 947 fake.specMutex.RLock() 948 defer fake.specMutex.RUnlock() 949 fake.taskMutex.RLock() 950 defer fake.taskMutex.RUnlock() 951 fake.updateMutex.RLock() 952 defer fake.updateMutex.RUnlock() 953 copiedInvocations := map[string][][]interface{}{} 954 for key, value := range fake.invocations { 955 copiedInvocations[key] = value 956 } 957 return copiedInvocations 958 } 959 960 func (fake *FakeContainer) recordInvocation(key string, args []interface{}) { 961 fake.invocationsMutex.Lock() 962 defer fake.invocationsMutex.Unlock() 963 if fake.invocations == nil { 964 fake.invocations = map[string][][]interface{}{} 965 } 966 if fake.invocations[key] == nil { 967 fake.invocations[key] = [][]interface{}{} 968 } 969 fake.invocations[key] = append(fake.invocations[key], args) 970 } 971 972 var _ containerd.Container = new(FakeContainer)