mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-13 05:46:16 +00:00
Merge pull request #124517 from wojtek-t/automated-cherry-pick-of-#124352-upstream-release-1.30
Automated cherry pick of #124352: Idempotent transformers in scheduler & kcm
This commit is contained in:
commit
43a0480e94
@ -581,7 +581,9 @@ func CreateControllerContext(ctx context.Context, s *config.CompletedConfig, roo
|
||||
// Informer transform to trim ManagedFields for memory efficiency.
|
||||
trim := func(obj interface{}) (interface{}, error) {
|
||||
if accessor, err := meta.Accessor(obj); err == nil {
|
||||
accessor.SetManagedFields(nil)
|
||||
if accessor.GetManagedFields() != nil {
|
||||
accessor.SetManagedFields(nil)
|
||||
}
|
||||
}
|
||||
return obj, nil
|
||||
}
|
||||
|
@ -549,7 +549,9 @@ func newPodInformer(cs clientset.Interface, resyncPeriod time.Duration) cache.Sh
|
||||
// The Extract workflow (i.e. `ExtractPod`) should be unused.
|
||||
trim := func(obj interface{}) (interface{}, error) {
|
||||
if accessor, err := meta.Accessor(obj); err == nil {
|
||||
accessor.SetManagedFields(nil)
|
||||
if accessor.GetManagedFields() != nil {
|
||||
accessor.SetManagedFields(nil)
|
||||
}
|
||||
}
|
||||
return obj, nil
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user