@@ -142,6 +142,21 @@ func (o *CreateOptions) ApplyOptions(opts []CreateOption) *CreateOptions {
142
142
return o
143
143
}
144
144
145
+ // ApplyToCreate implements CreateOption
146
+ func (o * CreateOptions ) ApplyToCreate (co * CreateOptions ) {
147
+ if o .DryRun != nil {
148
+ co .DryRun = o .DryRun
149
+ }
150
+ if o .FieldManager != "" {
151
+ co .FieldManager = o .FieldManager
152
+ }
153
+ if o .Raw != nil {
154
+ co .Raw = o .Raw
155
+ }
156
+ }
157
+
158
+ var _ CreateOption = & CreateOptions {}
159
+
145
160
// CreateDryRunAll sets the "dry run" option to "all".
146
161
//
147
162
// Deprecated: Use DryRunAll
@@ -211,6 +226,27 @@ func (o *DeleteOptions) ApplyOptions(opts []DeleteOption) *DeleteOptions {
211
226
return o
212
227
}
213
228
229
+ var _ DeleteOption = & DeleteOptions {}
230
+
231
+ // ApplyToDelete implements DeleteOption
232
+ func (o * DeleteOptions ) ApplyToDelete (do * DeleteOptions ) {
233
+ if o .GracePeriodSeconds != nil {
234
+ do .GracePeriodSeconds = o .GracePeriodSeconds
235
+ }
236
+ if o .Preconditions != nil {
237
+ do .Preconditions = o .Preconditions
238
+ }
239
+ if o .PropagationPolicy != nil {
240
+ do .PropagationPolicy = o .PropagationPolicy
241
+ }
242
+ if o .Raw != nil {
243
+ do .Raw = o .Raw
244
+ }
245
+ if o .DryRun != nil {
246
+ do .DryRun = o .DryRun
247
+ }
248
+ }
249
+
214
250
// GracePeriodSeconds sets the grace period for the deletion
215
251
// to the given number of seconds.
216
252
type GracePeriodSeconds int64
@@ -273,6 +309,24 @@ type ListOptions struct {
273
309
Raw * metav1.ListOptions
274
310
}
275
311
312
+ var _ ListOption = & ListOptions {}
313
+
314
+ // ApplyToList implements ListOption for ListOptions
315
+ func (o * ListOptions ) ApplyToList (lo * ListOptions ) {
316
+ if o .LabelSelector != nil {
317
+ lo .LabelSelector = o .LabelSelector
318
+ }
319
+ if o .FieldSelector != nil {
320
+ lo .FieldSelector = o .FieldSelector
321
+ }
322
+ if o .Namespace != "" {
323
+ lo .Namespace = o .Namespace
324
+ }
325
+ if o .Raw != nil {
326
+ lo .Raw = o .Raw
327
+ }
328
+ }
329
+
276
330
// AsListOptions returns these options as a flattened metav1.ListOptions.
277
331
// This may mutate the Raw field.
278
332
func (o * ListOptions ) AsListOptions () * metav1.ListOptions {
@@ -422,6 +476,21 @@ func (o *UpdateOptions) ApplyOptions(opts []UpdateOption) *UpdateOptions {
422
476
return o
423
477
}
424
478
479
+ var _ UpdateOption = & UpdateOptions {}
480
+
481
+ // ApplyToUpdate implements UpdateOption
482
+ func (o * UpdateOptions ) ApplyToUpdate (uo * UpdateOptions ) {
483
+ if o .DryRun != nil {
484
+ uo .DryRun = o .DryRun
485
+ }
486
+ if o .FieldManager != "" {
487
+ uo .FieldManager = o .FieldManager
488
+ }
489
+ if o .Raw != nil {
490
+ uo .Raw = o .Raw
491
+ }
492
+ }
493
+
425
494
// UpdateDryRunAll sets the "dry run" option to "all".
426
495
//
427
496
// Deprecated: Use DryRunAll
@@ -479,6 +548,24 @@ func (o *PatchOptions) AsPatchOptions() *metav1.PatchOptions {
479
548
return o .Raw
480
549
}
481
550
551
+ var _ PatchOption = & PatchOptions {}
552
+
553
+ // ApplyToPatch implements PatchOptions
554
+ func (o * PatchOptions ) ApplyToPatch (po * PatchOptions ) {
555
+ if o .DryRun != nil {
556
+ po .DryRun = o .DryRun
557
+ }
558
+ if o .Force != nil {
559
+ po .Force = o .Force
560
+ }
561
+ if o .FieldManager != "" {
562
+ po .FieldManager = o .FieldManager
563
+ }
564
+ if o .Raw != nil {
565
+ po .Raw = o .Raw
566
+ }
567
+ }
568
+
482
569
// ForceOwnership indicates that in case of conflicts with server-side apply,
483
570
// the client should acquire ownership of the conflicting field. Most
484
571
// controllers should use this.
@@ -518,4 +605,12 @@ func (o *DeleteAllOfOptions) ApplyOptions(opts []DeleteAllOfOption) *DeleteAllOf
518
605
return o
519
606
}
520
607
608
+ var _ DeleteAllOfOption = & DeleteAllOfOptions {}
609
+
610
+ // ApplyToDeleteAllOf implements DeleteAllOfOption
611
+ func (o * DeleteAllOfOptions ) ApplyToDeleteAllOf (do * DeleteAllOfOptions ) {
612
+ o .ApplyToList (& do .ListOptions )
613
+ o .ApplyToDelete (& do .DeleteOptions )
614
+ }
615
+
521
616
// }}}
0 commit comments