Skip to content

The transform function of the informer was overridden by the transform function of the InformerFactory #132367

Open
@likakuli

Description

@likakuli

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

Install tools

Container runtime (CRI) and version (if applicable)

Related plugins (CNI, CSI, ...) and versions (if applicable)

Metadata

Metadata

Assignees

Labels

kind/bugCategorizes issue or PR as related to a bug.sig/api-machineryCategorizes an issue or PR as relevant to SIG API Machinery.triage/acceptedIndicates an issue or PR is ready to be actively worked on.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions