@@ -393,19 +393,19 @@ var _ = Describe("Clientutils", func() {
393393 })
394394
395395 Describe ("ApplyAll" , func () {
396- It ("should return client.Apply for any object" , func () {
397- Expect (ApplyAll .PatchFor (cm )) .To (Equal (client . Apply ))
398- Expect (ApplyAll .PatchFor (secret )) .To (Equal (client . Apply ))
399- Expect (ApplyAll .PatchFor (uPod )) .To (Equal (client . Apply ))
396+ It ("should return an apply patch for any object" , func () {
397+ Expect (ApplyAll .PatchFor (cm ). Type ()) .To (Equal (types . ApplyPatchType ))
398+ Expect (ApplyAll .PatchFor (secret ). Type ()) .To (Equal (types . ApplyPatchType ))
399+ Expect (ApplyAll .PatchFor (uPod ). Type ()) .To (Equal (types . ApplyPatchType ))
400400 })
401401 })
402402
403403 Describe ("PatchRequestFromObjectAndProvider" , func () {
404404 It ("should create a patch request from the given object and provider" , func () {
405- patchProvider .EXPECT ().PatchFor (cm ).Return (client . Apply )
405+ patchProvider .EXPECT ().PatchFor (cm ).Return (ApplyAll . PatchFor ( cm ) )
406406 Expect (PatchRequestFromObjectAndProvider (cm , patchProvider )).To (Equal (PatchRequest {
407407 Object : cm ,
408- Patch : client . Apply ,
408+ Patch : ApplyAll . PatchFor ( cm ) ,
409409 }))
410410 })
411411 })
@@ -417,19 +417,19 @@ var _ = Describe("Clientutils", func() {
417417
418418 It ("should create patch requests from the given objects and provider" , func () {
419419 gomock .InOrder (
420- patchProvider .EXPECT ().PatchFor (cm ).Return (client . Apply ),
421- patchProvider .EXPECT ().PatchFor (secret ).Return (client . Apply ),
420+ patchProvider .EXPECT ().PatchFor (cm ).Return (ApplyAll . PatchFor ( cm ) ),
421+ patchProvider .EXPECT ().PatchFor (secret ).Return (ApplyAll . PatchFor ( secret ) ),
422422 )
423423
424424 Expect (PatchRequestsFromObjectsAndProvider ([]client.Object {cm , secret }, patchProvider )).To (Equal (
425425 []PatchRequest {
426426 {
427427 Object : cm ,
428- Patch : client . Apply ,
428+ Patch : ApplyAll . PatchFor ( cm ) ,
429429 },
430430 {
431431 Object : secret ,
432- Patch : client . Apply ,
432+ Patch : ApplyAll . PatchFor ( secret ) ,
433433 },
434434 },
435435 ))
@@ -445,11 +445,11 @@ var _ = Describe("Clientutils", func() {
445445 reqs := []PatchRequest {
446446 {
447447 Object : cm ,
448- Patch : client . Apply ,
448+ Patch : ApplyAll . PatchFor ( cm ) ,
449449 },
450450 {
451451 Object : secret ,
452- Patch : client . Apply ,
452+ Patch : ApplyAll . PatchFor ( secret ) ,
453453 },
454454 }
455455 Expect (ObjectsFromPatchRequests (reqs )).To (Equal ([]client.Object {cm , secret }))
@@ -461,15 +461,15 @@ var _ = Describe("Clientutils", func() {
461461 reqs := []PatchRequest {
462462 {
463463 Object : cm ,
464- Patch : client . Apply ,
464+ Patch : ApplyAll . PatchFor ( cm ) ,
465465 },
466466 {
467467 Object : secret ,
468- Patch : client . Apply ,
468+ Patch : ApplyAll . PatchFor ( secret ) ,
469469 },
470470 }
471471 someErr := fmt .Errorf ("some error" )
472- c .EXPECT ().Patch (ctx , cm , client . Apply ).Return (someErr )
472+ c .EXPECT ().Patch (ctx , cm , ApplyAll . PatchFor ( cm ) ).Return (someErr )
473473
474474 err := PatchMultiple (ctx , c , reqs )
475475 Expect (err ).To (HaveOccurred ())
@@ -480,16 +480,16 @@ var _ = Describe("Clientutils", func() {
480480 reqs := []PatchRequest {
481481 {
482482 Object : cm ,
483- Patch : client . Apply ,
483+ Patch : ApplyAll . PatchFor ( cm ) ,
484484 },
485485 {
486486 Object : secret ,
487- Patch : client . Apply ,
487+ Patch : ApplyAll . PatchFor ( secret ) ,
488488 },
489489 }
490490 gomock .InOrder (
491- c .EXPECT ().Patch (ctx , cm , client . Apply ),
492- c .EXPECT ().Patch (ctx , secret , client . Apply ),
491+ c .EXPECT ().Patch (ctx , cm , ApplyAll . PatchFor ( cm ) ),
492+ c .EXPECT ().Patch (ctx , secret , ApplyAll . PatchFor ( secret ) ),
493493 )
494494 Expect (PatchMultiple (ctx , c , reqs )).To (Succeed ())
495495 })
@@ -504,10 +504,10 @@ var _ = Describe("Clientutils", func() {
504504 It ("should abort and return any error from patching" , func () {
505505 someErr := fmt .Errorf ("some error" )
506506 gomock .InOrder (
507- patchProvider .EXPECT ().PatchFor (testdata .UnstructuredSecret ()).Return (client . Apply ),
508- patchProvider .EXPECT ().PatchFor (testdata .UnstructuredConfigMap ()).Return (client . Apply ),
507+ patchProvider .EXPECT ().PatchFor (testdata .UnstructuredSecret ()).Return (ApplyAll . PatchFor ( testdata . UnstructuredSecret ()) ),
508+ patchProvider .EXPECT ().PatchFor (testdata .UnstructuredConfigMap ()).Return (ApplyAll . PatchFor ( testdata . UnstructuredConfigMap ()) ),
509509
510- c .EXPECT ().Patch (ctx , testdata .UnstructuredSecret (), client . Apply ).Return (someErr ),
510+ c .EXPECT ().Patch (ctx , testdata .UnstructuredSecret (), ApplyAll . PatchFor ( testdata . UnstructuredSecret ()) ).Return (someErr ),
511511 )
512512
513513 _ , err := PatchMultipleFromFile (ctx , c , objectsPath , patchProvider )
@@ -517,11 +517,11 @@ var _ = Describe("Clientutils", func() {
517517
518518 It ("should patch multiple objects from file" , func () {
519519 gomock .InOrder (
520- patchProvider .EXPECT ().PatchFor (testdata .UnstructuredSecret ()).Return (client . Apply ),
521- patchProvider .EXPECT ().PatchFor (testdata .UnstructuredConfigMap ()).Return (client . Apply ),
520+ patchProvider .EXPECT ().PatchFor (testdata .UnstructuredSecret ()).Return (ApplyAll . PatchFor ( testdata . UnstructuredSecret ()) ),
521+ patchProvider .EXPECT ().PatchFor (testdata .UnstructuredConfigMap ()).Return (ApplyAll . PatchFor ( testdata . UnstructuredConfigMap ()) ),
522522
523- c .EXPECT ().Patch (ctx , testdata .UnstructuredSecret (), client . Apply ),
524- c .EXPECT ().Patch (ctx , testdata .UnstructuredConfigMap (), client . Apply ),
523+ c .EXPECT ().Patch (ctx , testdata .UnstructuredSecret (), ApplyAll . PatchFor ( testdata . UnstructuredSecret ()) ),
524+ c .EXPECT ().Patch (ctx , testdata .UnstructuredConfigMap (), ApplyAll . PatchFor ( testdata . UnstructuredConfigMap ()) ),
525525 )
526526
527527 objs , err := PatchMultipleFromFile (ctx , c , objectsPath , patchProvider )
0 commit comments