Files
kubernetes/pkg
Rodrigo Campos db6a2b2318 kubelet: Don't ignore idsPerPod config
The idsPerPod where completely ignored since they were introduced in PR:
	https://github.com/kubernetes/kubernetes/pull/130028

The problem was the following:
	1. The userns manager (as well as all managers) is created
	   before the config is copied to the kubelet object[1]
	2. The userns manager on creation is calling the kubelet_getter
	   GetUserNamespacesIDsPerPod to get the idsPerPod
	3. The getter checks the configuration stored in the kubelet
	   object, which hasn't been set at that point.
	4. As the config is nil (unset), it returns the default value.

Therefore, the value was ignored.

To solve this, let's just pass the idsPerPod as a parameter to
MakeUserNsManager(). This is the common pattern already used in the
kubelet initialization.

[1]: 461ba83084/pkg/kubelet/kubelet.go (L1078-L1087)
[2]: 461ba83084/pkg/kubelet/kubelet_getters.go (L145)

Signed-off-by: Rodrigo Campos <rodrigoca@microsoft.com>
2025-10-15 19:49:34 +09:00
..
2025-07-24 08:33:45 +02:00
2025-10-10 23:51:05 +08:00