@@ -52,6 +52,7 @@ func (uc *unstructuredClient) Create(ctx context.Context, obj Object, opts ...Cr
52
52
53
53
createOpts := & CreateOptions {}
54
54
createOpts .ApplyOptions (opts )
55
+
55
56
result := o .Post ().
56
57
NamespaceIfScoped (o .GetNamespace (), o .isNamespaced ()).
57
58
Resource (o .resource ()).
@@ -80,6 +81,7 @@ func (uc *unstructuredClient) Update(ctx context.Context, obj Object, opts ...Up
80
81
81
82
updateOpts := UpdateOptions {}
82
83
updateOpts .ApplyOptions (opts )
84
+
83
85
result := o .Put ().
84
86
NamespaceIfScoped (o .GetNamespace (), o .isNamespaced ()).
85
87
Resource (o .resource ()).
@@ -107,6 +109,7 @@ func (uc *unstructuredClient) Delete(ctx context.Context, obj Object, opts ...De
107
109
108
110
deleteOpts := DeleteOptions {}
109
111
deleteOpts .ApplyOptions (opts )
112
+
110
113
return o .Delete ().
111
114
NamespaceIfScoped (o .GetNamespace (), o .isNamespaced ()).
112
115
Resource (o .resource ()).
@@ -130,6 +133,7 @@ func (uc *unstructuredClient) DeleteAllOf(ctx context.Context, obj Object, opts
130
133
131
134
deleteAllOfOpts := DeleteAllOfOptions {}
132
135
deleteAllOfOpts .ApplyOptions (opts )
136
+
133
137
return o .Delete ().
134
138
NamespaceIfScoped (deleteAllOfOpts .ListOptions .Namespace , o .isNamespaced ()).
135
139
Resource (o .resource ()).
@@ -157,11 +161,13 @@ func (uc *unstructuredClient) Patch(ctx context.Context, obj Object, patch Patch
157
161
}
158
162
159
163
patchOpts := & PatchOptions {}
164
+ patchOpts .ApplyOptions (opts )
165
+
160
166
return o .Patch (patch .Type ()).
161
167
NamespaceIfScoped (o .GetNamespace (), o .isNamespaced ()).
162
168
Resource (o .resource ()).
163
169
Name (o .GetName ()).
164
- VersionedParams (patchOpts .ApplyOptions ( opts ). AsPatchOptions (), uc .paramCodec ).
170
+ VersionedParams (patchOpts .AsPatchOptions (), uc .paramCodec ).
165
171
Body (data ).
166
172
Do (ctx ).
167
173
Into (obj )
@@ -205,14 +211,15 @@ func (uc *unstructuredClient) List(ctx context.Context, obj ObjectList, opts ...
205
211
gvk .Kind = gvk .Kind [:len (gvk .Kind )- 4 ]
206
212
}
207
213
208
- listOpts := ListOptions {}
209
- listOpts .ApplyOptions (opts )
210
214
211
215
r , err := uc .cache .getResource (obj )
212
216
if err != nil {
213
217
return err
214
218
}
215
219
220
+ listOpts := ListOptions {}
221
+ listOpts .ApplyOptions (opts )
222
+
216
223
return r .Get ().
217
224
NamespaceIfScoped (listOpts .Namespace , r .isNamespaced ()).
218
225
Resource (r .resource ()).
@@ -232,13 +239,16 @@ func (uc *unstructuredClient) UpdateStatus(ctx context.Context, obj Object, opts
232
239
return err
233
240
}
234
241
242
+ updateOpts := UpdateOptions {}
243
+ updateOpts .ApplyOptions (opts )
244
+
235
245
return o .Put ().
236
246
NamespaceIfScoped (o .GetNamespace (), o .isNamespaced ()).
237
247
Resource (o .resource ()).
238
248
Name (o .GetName ()).
239
249
SubResource ("status" ).
240
250
Body (obj ).
241
- VersionedParams (( & UpdateOptions {}). ApplyOptions ( opts ) .AsUpdateOptions (), uc .paramCodec ).
251
+ VersionedParams (updateOpts .AsUpdateOptions (), uc .paramCodec ).
242
252
Do (ctx ).
243
253
Into (obj )
244
254
}
@@ -262,13 +272,15 @@ func (uc *unstructuredClient) PatchStatus(ctx context.Context, obj Object, patch
262
272
}
263
273
264
274
patchOpts := & PatchOptions {}
275
+ patchOpts .ApplyOptions (opts )
276
+
265
277
result := o .Patch (patch .Type ()).
266
278
NamespaceIfScoped (o .GetNamespace (), o .isNamespaced ()).
267
279
Resource (o .resource ()).
268
280
Name (o .GetName ()).
269
281
SubResource ("status" ).
270
282
Body (data ).
271
- VersionedParams (patchOpts .ApplyOptions ( opts ). AsPatchOptions (), uc .paramCodec ).
283
+ VersionedParams (patchOpts .AsPatchOptions (), uc .paramCodec ).
272
284
Do (ctx ).
273
285
Into (u )
274
286
0 commit comments