@@ -142,6 +142,21 @@ func (o *CreateOptions) ApplyOptions(opts []CreateOption) *CreateOptions {
142142 return o
143143}
144144
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+
145160// CreateDryRunAll sets the "dry run" option to "all".
146161//
147162// Deprecated: Use DryRunAll
@@ -211,6 +226,27 @@ func (o *DeleteOptions) ApplyOptions(opts []DeleteOption) *DeleteOptions {
211226 return o
212227}
213228
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+
214250// GracePeriodSeconds sets the grace period for the deletion
215251// to the given number of seconds.
216252type GracePeriodSeconds int64
@@ -273,6 +309,24 @@ type ListOptions struct {
273309 Raw * metav1.ListOptions
274310}
275311
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+
276330// AsListOptions returns these options as a flattened metav1.ListOptions.
277331// This may mutate the Raw field.
278332func (o * ListOptions ) AsListOptions () * metav1.ListOptions {
@@ -422,6 +476,21 @@ func (o *UpdateOptions) ApplyOptions(opts []UpdateOption) *UpdateOptions {
422476 return o
423477}
424478
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+
425494// UpdateDryRunAll sets the "dry run" option to "all".
426495//
427496// Deprecated: Use DryRunAll
@@ -479,6 +548,24 @@ func (o *PatchOptions) AsPatchOptions() *metav1.PatchOptions {
479548 return o .Raw
480549}
481550
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+
482569// ForceOwnership indicates that in case of conflicts with server-side apply,
483570// the client should acquire ownership of the conflicting field. Most
484571// controllers should use this.
@@ -518,4 +605,12 @@ func (o *DeleteAllOfOptions) ApplyOptions(opts []DeleteAllOfOption) *DeleteAllOf
518605 return o
519606}
520607
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+
521616// }}}
0 commit comments