@@ -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 ()).
@@ -107,6 +109,7 @@ func (uc *unstructuredClient) Delete(ctx context.Context, obj Object, opts ...De
107109
108110 deleteOpts := DeleteOptions {}
109111 deleteOpts .ApplyOptions (opts )
112+
110113 return o .Delete ().
111114 NamespaceIfScoped (o .GetNamespace (), o .isNamespaced ()).
112115 Resource (o .resource ()).
@@ -130,6 +133,7 @@ func (uc *unstructuredClient) DeleteAllOf(ctx context.Context, obj Object, opts
130133
131134 deleteAllOfOpts := DeleteAllOfOptions {}
132135 deleteAllOfOpts .ApplyOptions (opts )
136+
133137 return o .Delete ().
134138 NamespaceIfScoped (deleteAllOfOpts .ListOptions .Namespace , o .isNamespaced ()).
135139 Resource (o .resource ()).
@@ -157,11 +161,13 @@ func (uc *unstructuredClient) Patch(ctx context.Context, obj Object, patch Patch
157161 }
158162
159163 patchOpts := & PatchOptions {}
164+ patchOpts .ApplyOptions (opts )
165+
160166 return o .Patch (patch .Type ()).
161167 NamespaceIfScoped (o .GetNamespace (), o .isNamespaced ()).
162168 Resource (o .resource ()).
163169 Name (o .GetName ()).
164- VersionedParams (patchOpts .ApplyOptions ( opts ). AsPatchOptions (), uc .paramCodec ).
170+ VersionedParams (patchOpts .AsPatchOptions (), uc .paramCodec ).
165171 Body (data ).
166172 Do (ctx ).
167173 Into (obj )
@@ -205,14 +211,14 @@ func (uc *unstructuredClient) List(ctx context.Context, obj ObjectList, opts ...
205211 gvk .Kind = gvk .Kind [:len (gvk .Kind )- 4 ]
206212 }
207213
208- listOpts := ListOptions {}
209- listOpts .ApplyOptions (opts )
210-
211214 r , err := uc .cache .getResource (obj )
212215 if err != nil {
213216 return err
214217 }
215218
219+ listOpts := ListOptions {}
220+ listOpts .ApplyOptions (opts )
221+
216222 return r .Get ().
217223 NamespaceIfScoped (listOpts .Namespace , r .isNamespaced ()).
218224 Resource (r .resource ()).
@@ -232,13 +238,16 @@ func (uc *unstructuredClient) UpdateStatus(ctx context.Context, obj Object, opts
232238 return err
233239 }
234240
241+ updateOpts := UpdateOptions {}
242+ updateOpts .ApplyOptions (opts )
243+
235244 return o .Put ().
236245 NamespaceIfScoped (o .GetNamespace (), o .isNamespaced ()).
237246 Resource (o .resource ()).
238247 Name (o .GetName ()).
239248 SubResource ("status" ).
240249 Body (obj ).
241- VersionedParams (( & UpdateOptions {}). ApplyOptions ( opts ) .AsUpdateOptions (), uc .paramCodec ).
250+ VersionedParams (updateOpts .AsUpdateOptions (), uc .paramCodec ).
242251 Do (ctx ).
243252 Into (obj )
244253}
@@ -262,13 +271,15 @@ func (uc *unstructuredClient) PatchStatus(ctx context.Context, obj Object, patch
262271 }
263272
264273 patchOpts := & PatchOptions {}
274+ patchOpts .ApplyOptions (opts )
275+
265276 result := o .Patch (patch .Type ()).
266277 NamespaceIfScoped (o .GetNamespace (), o .isNamespaced ()).
267278 Resource (o .resource ()).
268279 Name (o .GetName ()).
269280 SubResource ("status" ).
270281 Body (data ).
271- VersionedParams (patchOpts .ApplyOptions ( opts ). AsPatchOptions (), uc .paramCodec ).
282+ VersionedParams (patchOpts .AsPatchOptions (), uc .paramCodec ).
272283 Do (ctx ).
273284 Into (u )
274285
0 commit comments