@@ -52,6 +52,7 @@ func (uc *unstructuredClient) Create(ctx context.Context, obj Object, opts ...Cr
5252
5353 createOpts := & CreateOptions {}
5454 createOpts .ApplyOptions (opts )
55+
5556 result := o .Post ().
5657 NamespaceIfScoped (o .GetNamespace (), o .isNamespaced ()).
5758 Resource (o .resource ()).
@@ -80,6 +81,7 @@ func (uc *unstructuredClient) Update(ctx context.Context, obj Object, opts ...Up
8081
8182 updateOpts := UpdateOptions {}
8283 updateOpts .ApplyOptions (opts )
84+
8385 result := o .Put ().
8486 NamespaceIfScoped (o .GetNamespace (), o .isNamespaced ()).
8587 Resource (o .resource ()).
@@ -106,6 +108,7 @@ func (uc *unstructuredClient) Delete(ctx context.Context, obj Object, opts ...De
106108
107109 deleteOpts := DeleteOptions {}
108110 deleteOpts .ApplyOptions (opts )
111+
109112 return o .Delete ().
110113 NamespaceIfScoped (o .GetNamespace (), o .isNamespaced ()).
111114 Resource (o .resource ()).
@@ -128,6 +131,7 @@ func (uc *unstructuredClient) DeleteAllOf(ctx context.Context, obj Object, opts
128131
129132 deleteAllOfOpts := DeleteAllOfOptions {}
130133 deleteAllOfOpts .ApplyOptions (opts )
134+
131135 return o .Delete ().
132136 NamespaceIfScoped (deleteAllOfOpts .ListOptions .Namespace , o .isNamespaced ()).
133137 Resource (o .resource ()).
@@ -154,11 +158,13 @@ func (uc *unstructuredClient) Patch(ctx context.Context, obj Object, patch Patch
154158 }
155159
156160 patchOpts := & PatchOptions {}
161+ patchOpts .ApplyOptions (opts )
162+
157163 return o .Patch (patch .Type ()).
158164 NamespaceIfScoped (o .GetNamespace (), o .isNamespaced ()).
159165 Resource (o .resource ()).
160166 Name (o .GetName ()).
161- VersionedParams (patchOpts .ApplyOptions ( opts ). AsPatchOptions (), uc .paramCodec ).
167+ VersionedParams (patchOpts .AsPatchOptions (), uc .paramCodec ).
162168 Body (data ).
163169 Do (ctx ).
164170 Into (obj )
@@ -204,14 +210,14 @@ func (uc *unstructuredClient) List(ctx context.Context, obj ObjectList, opts ...
204210 gvk := u .GroupVersionKind ()
205211 gvk .Kind = strings .TrimSuffix (gvk .Kind , "List" )
206212
207- listOpts := ListOptions {}
208- listOpts .ApplyOptions (opts )
209-
210213 r , err := uc .cache .getResource (obj )
211214 if err != nil {
212215 return err
213216 }
214217
218+ listOpts := ListOptions {}
219+ listOpts .ApplyOptions (opts )
220+
215221 return r .Get ().
216222 NamespaceIfScoped (listOpts .Namespace , r .isNamespaced ()).
217223 Resource (r .resource ()).
@@ -230,13 +236,16 @@ func (uc *unstructuredClient) UpdateStatus(ctx context.Context, obj Object, opts
230236 return err
231237 }
232238
239+ updateOpts := UpdateOptions {}
240+ updateOpts .ApplyOptions (opts )
241+
233242 return o .Put ().
234243 NamespaceIfScoped (o .GetNamespace (), o .isNamespaced ()).
235244 Resource (o .resource ()).
236245 Name (o .GetName ()).
237246 SubResource ("status" ).
238247 Body (obj ).
239- VersionedParams (( & UpdateOptions {}). ApplyOptions ( opts ) .AsUpdateOptions (), uc .paramCodec ).
248+ VersionedParams (updateOpts .AsUpdateOptions (), uc .paramCodec ).
240249 Do (ctx ).
241250 Into (obj )
242251}
@@ -260,13 +269,15 @@ func (uc *unstructuredClient) PatchStatus(ctx context.Context, obj Object, patch
260269 }
261270
262271 patchOpts := & PatchOptions {}
272+ patchOpts .ApplyOptions (opts )
273+
263274 result := o .Patch (patch .Type ()).
264275 NamespaceIfScoped (o .GetNamespace (), o .isNamespaced ()).
265276 Resource (o .resource ()).
266277 Name (o .GetName ()).
267278 SubResource ("status" ).
268279 Body (data ).
269- VersionedParams (patchOpts .ApplyOptions ( opts ). AsPatchOptions (), uc .paramCodec ).
280+ VersionedParams (patchOpts .AsPatchOptions (), uc .paramCodec ).
270281 Do (ctx ).
271282 Into (u )
272283
0 commit comments