@@ -276,7 +276,7 @@ var _ = Describe("Client", func() {
276
276
Expect (cl ).NotTo (BeNil ())
277
277
278
278
By ("creating the object (with DryRun)" )
279
- err = cl .Create (context .TODO (), dep , client .CreateDryRunAll () )
279
+ err = cl .Create (context .TODO (), dep , client .CreateDryRunAll )
280
280
Expect (err ).NotTo (HaveOccurred ())
281
281
282
282
actual , err := clientset .AppsV1 ().Deployments (ns ).Get (dep .Name , metav1.GetOptions {})
@@ -415,7 +415,7 @@ var _ = Describe("Client", func() {
415
415
})
416
416
417
417
By ("creating the object" )
418
- err = cl .Create (context .TODO (), u , client .CreateDryRunAll () )
418
+ err = cl .Create (context .TODO (), u , client .CreateDryRunAll )
419
419
Expect (err ).NotTo (HaveOccurred ())
420
420
421
421
actual , err := clientset .AppsV1 ().Deployments (ns ).Get (dep .Name , metav1.GetOptions {})
@@ -1074,7 +1074,7 @@ var _ = Describe("Client", func() {
1074
1074
Expect (err ).NotTo (HaveOccurred ())
1075
1075
1076
1076
By ("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 )
1078
1078
Expect (err ).NotTo (HaveOccurred ())
1079
1079
1080
1080
By ("validating patched Deployment doesn't have the new annotation" )
@@ -1183,7 +1183,7 @@ var _ = Describe("Client", func() {
1183
1183
Kind : "Deployment" ,
1184
1184
Version : "v1" ,
1185
1185
})
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 )
1187
1187
Expect (err ).NotTo (HaveOccurred ())
1188
1188
1189
1189
By ("validating patched Deployment does not have the new annotation" )
@@ -2000,7 +2000,7 @@ var _ = Describe("Client", func() {
2000
2000
Describe ("CreateOptions" , func () {
2001
2001
It ("should allow setting DryRun to 'all'" , func () {
2002
2002
co := & client.CreateOptions {}
2003
- client .CreateDryRunAll ()( co )
2003
+ client .CreateDryRunAll (co )
2004
2004
all := []string {metav1 .DryRunAll }
2005
2005
Expect (co .AsCreateOptions ().DryRun ).To (Equal (all ))
2006
2006
})
@@ -2141,7 +2141,7 @@ var _ = Describe("Client", func() {
2141
2141
Describe ("UpdateOptions" , func () {
2142
2142
It ("should allow setting DryRun to 'all'" , func () {
2143
2143
uo := & client.UpdateOptions {}
2144
- client .UpdateDryRunAll ()( uo )
2144
+ client .UpdateDryRunAll (uo )
2145
2145
all := []string {metav1 .DryRunAll }
2146
2146
Expect (uo .AsUpdateOptions ().DryRun ).To (Equal (all ))
2147
2147
})
@@ -2157,19 +2157,25 @@ var _ = Describe("Client", func() {
2157
2157
Describe ("PatchOptions" , func () {
2158
2158
It ("should allow setting DryRun to 'all'" , func () {
2159
2159
po := & client.PatchOptions {}
2160
- client .PatchDryRunAll ()( po )
2160
+ client .PatchDryRunAll (po )
2161
2161
all := []string {metav1 .DryRunAll }
2162
2162
Expect (po .AsPatchOptions ().DryRun ).To (Equal (all ))
2163
2163
})
2164
2164
2165
2165
It ("should allow setting Force to 'true'" , func () {
2166
2166
po := & client.PatchOptions {}
2167
- client .PatchWithForce () (po )
2167
+ client .ForceOwnership (po )
2168
2168
mpo := po .AsPatchOptions ()
2169
2169
Expect (mpo .Force ).NotTo (BeNil ())
2170
2170
Expect (* mpo .Force ).To (BeTrue ())
2171
2171
})
2172
2172
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
+
2173
2179
It ("should produce empty metav1.PatchOptions if nil" , func () {
2174
2180
var po * client.PatchOptions
2175
2181
Expect (po .AsPatchOptions ()).To (Equal (& metav1.PatchOptions {}))
0 commit comments