mirror of
https://github.com/k3s-io/kubernetes.git
synced 2026-07-18 13:57:38 +00:00
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>