mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-27 05:27:21 +00:00
pkg/kubelet: Explain why a user is required to get userns kubelet mappings
Signed-off-by: Rodrigo Campos <rodrigoca@microsoft.com>
This commit is contained in:
parent
c984f0f08a
commit
69e270f509
@ -131,6 +131,12 @@ func (kl *Kubelet) getKubeletMappings() (uint32, uint32, error) {
|
|||||||
return defaultFirstID, defaultLen, nil
|
return defaultFirstID, defaultLen, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// We NEED to check for the user because getsubids can be configured to gather the response
|
||||||
|
// with a remote call and we can't distinguish between the remote endpoint not being reachable
|
||||||
|
// and the remote endpoint is reachable but no entry is present for the user.
|
||||||
|
// So we check for the kubelet user first, if it exist and getsubids is present, we expect
|
||||||
|
// to get _some_ configuration. If the user exist and getsubids doesn't give us any
|
||||||
|
// configuration, then we consider the remote down and fail to start the kubelet.
|
||||||
_, err := user.Lookup(kubeletUser)
|
_, err := user.Lookup(kubeletUser)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
var unknownUserErr user.UnknownUserError
|
var unknownUserErr user.UnknownUserError
|
||||||
|
Loading…
Reference in New Issue
Block a user