@@ -86,27 +86,27 @@ var _ = Describe("GetOptions", func() {
8686var _ = Describe ("CreateOptions" , func () {
8787 It ("Should set DryRun" , func () {
8888 o := & client.CreateOptions {DryRun : []string {"Hello" , "Theodore" }}
89- newCreatOpts := & client.CreateOptions {}
90- o .ApplyToCreate (newCreatOpts )
91- Expect (newCreatOpts ).To (Equal (o ))
89+ newCreateOpts := & client.CreateOptions {}
90+ o .ApplyToCreate (newCreateOpts )
91+ Expect (newCreateOpts ).To (Equal (o ))
9292 })
9393 It ("Should set FieldManager" , func () {
9494 o := & client.CreateOptions {FieldManager : "FieldManager" }
95- newCreatOpts := & client.CreateOptions {}
96- o .ApplyToCreate (newCreatOpts )
97- Expect (newCreatOpts ).To (Equal (o ))
95+ newCreateOpts := & client.CreateOptions {}
96+ o .ApplyToCreate (newCreateOpts )
97+ Expect (newCreateOpts ).To (Equal (o ))
9898 })
9999 It ("Should set Raw" , func () {
100100 o := & client.CreateOptions {Raw : & metav1.CreateOptions {DryRun : []string {"Bye" , "Theodore" }}}
101- newCreatOpts := & client.CreateOptions {}
102- o .ApplyToCreate (newCreatOpts )
103- Expect (newCreatOpts ).To (Equal (o ))
101+ newCreateOpts := & client.CreateOptions {}
102+ o .ApplyToCreate (newCreateOpts )
103+ Expect (newCreateOpts ).To (Equal (o ))
104104 })
105105 It ("Should not set anything" , func () {
106106 o := & client.CreateOptions {}
107- newCreatOpts := & client.CreateOptions {}
108- o .ApplyToCreate (newCreatOpts )
109- Expect (newCreatOpts ).To (Equal (o ))
107+ newCreateOpts := & client.CreateOptions {}
108+ o .ApplyToCreate (newCreateOpts )
109+ Expect (newCreateOpts ).To (Equal (o ))
110110 })
111111})
112112
@@ -238,3 +238,42 @@ var _ = Describe("MatchingLabels", func() {
238238 Expect (err .Error ()).To (Equal (expectedErrMsg ))
239239 })
240240})
241+
242+ var _ = Describe ("FieldOwner" , func () {
243+ It ("Should apply to PatchOptions" , func () {
244+ o := & client.PatchOptions {FieldManager : "bar" }
245+ t := client .FieldOwner ("foo" )
246+ t .ApplyToPatch (o )
247+ Expect (o .FieldManager ).To (Equal ("foo" ))
248+ })
249+ It ("Should apply to CreateOptions" , func () {
250+ o := & client.CreateOptions {FieldManager : "bar" }
251+ t := client .FieldOwner ("foo" )
252+ t .ApplyToCreate (o )
253+ Expect (o .FieldManager ).To (Equal ("foo" ))
254+ })
255+ It ("Should apply to UpdateOptions" , func () {
256+ o := & client.UpdateOptions {FieldManager : "bar" }
257+ t := client .FieldOwner ("foo" )
258+ t .ApplyToUpdate (o )
259+ Expect (o .FieldManager ).To (Equal ("foo" ))
260+ })
261+ It ("Should apply to SubResourcePatchOptions" , func () {
262+ o := & client.SubResourcePatchOptions {PatchOptions : client.PatchOptions {FieldManager : "bar" }}
263+ t := client .FieldOwner ("foo" )
264+ t .ApplyToSubResourcePatch (o )
265+ Expect (o .FieldManager ).To (Equal ("foo" ))
266+ })
267+ It ("Should apply to SubResourceCreateOptions" , func () {
268+ o := & client.SubResourceCreateOptions {CreateOptions : client.CreateOptions {FieldManager : "bar" }}
269+ t := client .FieldOwner ("foo" )
270+ t .ApplyToSubResourceCreate (o )
271+ Expect (o .FieldManager ).To (Equal ("foo" ))
272+ })
273+ It ("Should apply to SubResourceUpdateOptions" , func () {
274+ o := & client.SubResourceUpdateOptions {UpdateOptions : client.UpdateOptions {FieldManager : "bar" }}
275+ t := client .FieldOwner ("foo" )
276+ t .ApplyToSubResourceUpdate (o )
277+ Expect (o .FieldManager ).To (Equal ("foo" ))
278+ })
279+ })
0 commit comments