@@ -86,27 +86,27 @@ var _ = Describe("GetOptions", func() {
86
86
var _ = Describe ("CreateOptions" , func () {
87
87
It ("Should set DryRun" , func () {
88
88
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 ))
92
92
})
93
93
It ("Should set FieldManager" , func () {
94
94
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 ))
98
98
})
99
99
It ("Should set Raw" , func () {
100
100
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 ))
104
104
})
105
105
It ("Should not set anything" , func () {
106
106
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 ))
110
110
})
111
111
})
112
112
@@ -238,3 +238,42 @@ var _ = Describe("MatchingLabels", func() {
238
238
Expect (err .Error ()).To (Equal (expectedErrMsg ))
239
239
})
240
240
})
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