@@ -276,7 +276,7 @@ var _ = Describe("Client", func() {
276276Expect (cl ).NotTo (BeNil ())
277277
278278By ("creating the object (with DryRun)" )
279- err = cl .Create (context .TODO (), dep , client .CreateDryRunAll () )
279+ err = cl .Create (context .TODO (), dep , client .CreateDryRunAll )
280280Expect (err ).NotTo (HaveOccurred ())
281281
282282actual , err := clientset .AppsV1 ().Deployments (ns ).Get (dep .Name , metav1.GetOptions {})
@@ -415,7 +415,7 @@ var _ = Describe("Client", func() {
415415})
416416
417417By ("creating the object" )
418- err = cl .Create (context .TODO (), u , client .CreateDryRunAll () )
418+ err = cl .Create (context .TODO (), u , client .CreateDryRunAll )
419419Expect (err ).NotTo (HaveOccurred ())
420420
421421actual , err := clientset .AppsV1 ().Deployments (ns ).Get (dep .Name , metav1.GetOptions {})
@@ -1074,7 +1074,7 @@ var _ = Describe("Client", func() {
10741074Expect (err ).NotTo (HaveOccurred ())
10751075
10761076By ("patching the Deployment with dry-run" )
1077- err = cl .Patch (context .TODO (), dep , client .ConstantPatch (types .MergePatchType , mergePatch ), client .PatchDryRunAll () )
1077+ err = cl .Patch (context .TODO (), dep , client .ConstantPatch (types .MergePatchType , mergePatch ), client .PatchDryRunAll )
10781078Expect (err ).NotTo (HaveOccurred ())
10791079
10801080By ("validating patched Deployment doesn't have the new annotation" )
@@ -1183,7 +1183,7 @@ var _ = Describe("Client", func() {
11831183Kind : "Deployment" ,
11841184Version : "v1" ,
11851185})
1186- err = cl .Patch (context .TODO (), u , client .ConstantPatch (types .MergePatchType , mergePatch ), client .PatchDryRunAll () )
1186+ err = cl .Patch (context .TODO (), u , client .ConstantPatch (types .MergePatchType , mergePatch ), client .PatchDryRunAll )
11871187Expect (err ).NotTo (HaveOccurred ())
11881188
11891189By ("validating patched Deployment does not have the new annotation" )
@@ -2000,7 +2000,7 @@ var _ = Describe("Client", func() {
20002000Describe ("CreateOptions" , func () {
20012001It ("should allow setting DryRun to 'all'" , func () {
20022002co := & client.CreateOptions {}
2003- client .CreateDryRunAll ()( co )
2003+ client .CreateDryRunAll (co )
20042004all := []string {metav1 .DryRunAll }
20052005Expect (co .AsCreateOptions ().DryRun ).To (Equal (all ))
20062006})
@@ -2141,7 +2141,7 @@ var _ = Describe("Client", func() {
21412141Describe ("UpdateOptions" , func () {
21422142It ("should allow setting DryRun to 'all'" , func () {
21432143uo := & client.UpdateOptions {}
2144- client .UpdateDryRunAll ()( uo )
2144+ client .UpdateDryRunAll (uo )
21452145all := []string {metav1 .DryRunAll }
21462146Expect (uo .AsUpdateOptions ().DryRun ).To (Equal (all ))
21472147})
@@ -2157,19 +2157,25 @@ var _ = Describe("Client", func() {
21572157Describe ("PatchOptions" , func () {
21582158It ("should allow setting DryRun to 'all'" , func () {
21592159po := & client.PatchOptions {}
2160- client .PatchDryRunAll ()( po )
2160+ client .PatchDryRunAll (po )
21612161all := []string {metav1 .DryRunAll }
21622162Expect (po .AsPatchOptions ().DryRun ).To (Equal (all ))
21632163})
21642164
21652165It ("should allow setting Force to 'true'" , func () {
21662166po := & client.PatchOptions {}
2167- client .PatchWithForce () (po )
2167+ client .ForceOwnership (po )
21682168mpo := po .AsPatchOptions ()
21692169Expect (mpo .Force ).NotTo (BeNil ())
21702170Expect (* mpo .Force ).To (BeTrue ())
21712171})
21722172
2173+ It ("should allow setting the field manager" , func () {
2174+ po := & client.PatchOptions {}
2175+ client .FieldOwner ("some-owner" )(po )
2176+ Expect (po .AsPatchOptions ().FieldManager ).To (Equal ("some-owner" ))
2177+ })
2178+
21732179It ("should produce empty metav1.PatchOptions if nil" , func () {
21742180var po * client.PatchOptions
21752181Expect (po .AsPatchOptions ()).To (Equal (& metav1.PatchOptions {}))
0 commit comments