@@ -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,14 @@ 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
-
211
214
r , err := uc .cache .getResource (obj )
212
215
if err != nil {
213
216
return err
214
217
}
215
218
219
+ listOpts := ListOptions {}
220
+ listOpts .ApplyOptions (opts )
221
+
216
222
return r .Get ().
217
223
NamespaceIfScoped (listOpts .Namespace , r .isNamespaced ()).
218
224
Resource (r .resource ()).
@@ -232,13 +238,16 @@ func (uc *unstructuredClient) UpdateStatus(ctx context.Context, obj Object, opts
232
238
return err
233
239
}
234
240
241
+ updateOpts := UpdateOptions {}
242
+ updateOpts .ApplyOptions (opts )
243
+
235
244
return o .Put ().
236
245
NamespaceIfScoped (o .GetNamespace (), o .isNamespaced ()).
237
246
Resource (o .resource ()).
238
247
Name (o .GetName ()).
239
248
SubResource ("status" ).
240
249
Body (obj ).
241
- VersionedParams (( & UpdateOptions {}). ApplyOptions ( opts ) .AsUpdateOptions (), uc .paramCodec ).
250
+ VersionedParams (updateOpts .AsUpdateOptions (), uc .paramCodec ).
242
251
Do (ctx ).
243
252
Into (obj )
244
253
}
@@ -262,13 +271,15 @@ func (uc *unstructuredClient) PatchStatus(ctx context.Context, obj Object, patch
262
271
}
263
272
264
273
patchOpts := & PatchOptions {}
274
+ patchOpts .ApplyOptions (opts )
275
+
265
276
result := o .Patch (patch .Type ()).
266
277
NamespaceIfScoped (o .GetNamespace (), o .isNamespaced ()).
267
278
Resource (o .resource ()).
268
279
Name (o .GetName ()).
269
280
SubResource ("status" ).
270
281
Body (data ).
271
- VersionedParams (patchOpts .ApplyOptions ( opts ). AsPatchOptions (), uc .paramCodec ).
282
+ VersionedParams (patchOpts .AsPatchOptions (), uc .paramCodec ).
272
283
Do (ctx ).
273
284
Into (u )
274
285
0 commit comments