@@ -417,6 +417,12 @@ type ListOptions struct {
417
417
// it has expired. This field is not supported if watch is true in the Raw ListOptions.
418
418
Continue string
419
419
420
+ // UnsafeDisableDeepCopy indicates not to deep copy objects during list objects.
421
+ // Be very careful with this, when enabled you must DeepCopy any object before mutating it,
422
+ // otherwise you will mutate the object in the cache.
423
+ // +optional
424
+ UnsafeDisableDeepCopy * bool
425
+
420
426
// Raw represents raw ListOptions, as passed to the API server. Note
421
427
// that these may not be respected by all implementations of interface,
422
428
// and the LabelSelector, FieldSelector, Limit and Continue fields are ignored.
@@ -445,6 +451,9 @@ func (o *ListOptions) ApplyToList(lo *ListOptions) {
445
451
if o .Continue != "" {
446
452
lo .Continue = o .Continue
447
453
}
454
+ if o .UnsafeDisableDeepCopy != nil {
455
+ lo .UnsafeDisableDeepCopy = o .UnsafeDisableDeepCopy
456
+ }
448
457
}
449
458
450
459
// AsListOptions returns these options as a flattened metav1.ListOptions.
@@ -587,6 +596,25 @@ func (l Limit) ApplyToList(opts *ListOptions) {
587
596
opts .Limit = int64 (l )
588
597
}
589
598
599
+ // UnsafeDisableDeepCopyOption indicates not to deep copy objects during list objects.
600
+ // Be very careful with this, when enabled you must DeepCopy any object before mutating it,
601
+ // otherwise you will mutate the object in the cache.
602
+ type UnsafeDisableDeepCopyOption bool
603
+
604
+ // ApplyToList applies this configuration to the given an List options.
605
+ func (d UnsafeDisableDeepCopyOption ) ApplyToList (opts * ListOptions ) {
606
+ definitelyTrue := true
607
+ definitelyFalse := false
608
+ if d {
609
+ opts .UnsafeDisableDeepCopy = & definitelyTrue
610
+ } else {
611
+ opts .UnsafeDisableDeepCopy = & definitelyFalse
612
+ }
613
+ }
614
+
615
+ // UnsafeDisableDeepCopy indicates not to deep copy objects during list objects.
616
+ const UnsafeDisableDeepCopy = UnsafeDisableDeepCopyOption (true )
617
+
590
618
// Continue sets a continuation token to retrieve chunks of results when using limit.
591
619
// Continue does not implement DeleteAllOfOption interface because the server
592
620
// does not support setting it for deletecollection operations.
0 commit comments