Open
Description
What happened?
This PR #118455 introduces a transform function and a method to set it for the InformerFactory. When InformerFor is called, it sets the transform function for the informer.
The issue is that even if the informer already has a transform and the InformerFactory does not, the factory’s transform will still overwrite the one set on the informer.
As a result, the logic in kube-scheduler that removes managedFields becomes ineffective. #119556
What did you expect to happen?
Only when the informer's transform is nil and the InformerFactory's transform is not nil will the InformerFactory's transform be used to set the informer's transform.
How can we reproduce it (as minimally and precisely as possible)?
add some debug log to print pod info in the kube-scheduler, then you can see the managedFields exists.
Anything else we need to know?
#131016 (comment)
#131016 (comment)
Kubernetes version
master
```console
$ kubectl version
# paste output here
```
Cloud provider
OS version
# On Linux:
$ cat /etc/os-release
# paste output here
$ uname -a
# paste output here
# On Windows:
C:\> wmic os get Caption, Version, BuildNumber, OSArchitecture
# paste output here