@@ -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()).
@@ -106,6 +108,7 @@ func (uc *unstructuredClient) Delete(ctx context.Context, obj Object, opts ...De
106
108
107
109
deleteOpts := DeleteOptions{}
108
110
deleteOpts.ApplyOptions(opts)
111
+
109
112
return o.Delete().
110
113
NamespaceIfScoped(o.GetNamespace(), o.isNamespaced()).
111
114
Resource(o.resource()).
@@ -128,6 +131,7 @@ func (uc *unstructuredClient) DeleteAllOf(ctx context.Context, obj Object, opts
128
131
129
132
deleteAllOfOpts := DeleteAllOfOptions{}
130
133
deleteAllOfOpts.ApplyOptions(opts)
134
+
131
135
return o.Delete().
132
136
NamespaceIfScoped(deleteAllOfOpts.ListOptions.Namespace, o.isNamespaced()).
133
137
Resource(o.resource()).
@@ -154,11 +158,13 @@ func (uc *unstructuredClient) Patch(ctx context.Context, obj Object, patch Patch
154
158
}
155
159
156
160
patchOpts := &PatchOptions{}
161
+ patchOpts.ApplyOptions(opts)
162
+
157
163
return o.Patch(patch.Type()).
158
164
NamespaceIfScoped(o.GetNamespace(), o.isNamespaced()).
159
165
Resource(o.resource()).
160
166
Name(o.GetName()).
161
- VersionedParams(patchOpts.ApplyOptions(opts). AsPatchOptions(), uc.paramCodec).
167
+ VersionedParams(patchOpts.AsPatchOptions(), uc.paramCodec).
162
168
Body(data).
163
169
Do(ctx).
164
170
Into(obj)
@@ -204,14 +210,14 @@ func (uc *unstructuredClient) List(ctx context.Context, obj ObjectList, opts ...
204
210
gvk := u.GroupVersionKind()
205
211
gvk.Kind = strings.TrimSuffix(gvk.Kind, "List")
206
212
207
- listOpts := ListOptions{}
208
- listOpts.ApplyOptions(opts)
209
-
210
213
r, err := uc.cache.getResource(obj)
211
214
if err != nil {
212
215
return err
213
216
}
214
217
218
+ listOpts := ListOptions{}
219
+ listOpts.ApplyOptions(opts)
220
+
215
221
return r.Get().
216
222
NamespaceIfScoped(listOpts.Namespace, r.isNamespaced()).
217
223
Resource(r.resource()).
@@ -230,13 +236,16 @@ func (uc *unstructuredClient) UpdateStatus(ctx context.Context, obj Object, opts
230
236
return err
231
237
}
232
238
239
+ updateOpts := UpdateOptions{}
240
+ updateOpts.ApplyOptions(opts)
241
+
233
242
return o.Put().
234
243
NamespaceIfScoped(o.GetNamespace(), o.isNamespaced()).
235
244
Resource(o.resource()).
236
245
Name(o.GetName()).
237
246
SubResource("status").
238
247
Body(obj).
239
- VersionedParams((&UpdateOptions{}).ApplyOptions(opts) .AsUpdateOptions(), uc.paramCodec).
248
+ VersionedParams(updateOpts .AsUpdateOptions(), uc.paramCodec).
240
249
Do(ctx).
241
250
Into(obj)
242
251
}
@@ -260,13 +269,15 @@ func (uc *unstructuredClient) PatchStatus(ctx context.Context, obj Object, patch
260
269
}
261
270
262
271
patchOpts := &PatchOptions{}
272
+ patchOpts.ApplyOptions(opts)
273
+
263
274
result := o.Patch(patch.Type()).
264
275
NamespaceIfScoped(o.GetNamespace(), o.isNamespaced()).
265
276
Resource(o.resource()).
266
277
Name(o.GetName()).
267
278
SubResource("status").
268
279
Body(data).
269
- VersionedParams(patchOpts.ApplyOptions(opts). AsPatchOptions(), uc.paramCodec).
280
+ VersionedParams(patchOpts.AsPatchOptions(), uc.paramCodec).
270
281
Do(ctx).
271
282
Into(u)
272
283
0 commit comments