os/user: Current fails with "unknown userid" when it finds no entry about the user in "/etc/passwd" #38599
Labels
FrozenDueToAge
WaitingForInfo
Issue is not actionable because of missing required information, which needs to be provided.
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
I don't know, I'm reporting a (not a) bug issue from a software I'm trying to use
What operating system and processor architecture are you using (
go env
)?What did you do?
I'm not a go developer, but I was trying to use a software based on go v 1.11, named jobber, on my openshift infrastructure.
Openshift uses, for security purposes, a policy called "arbitrary user id" to run its containers. This means when a container starts, a user with a "random" id is used to run all the processes in that container. This user is not "added" the unix way, and has no entry in /etc/passwd.
It has no name, and no home, but it has an ID.
The software couldn't start because it was failing when calling the method
user.Current
, which returnedunknown userid: 1000140000
What did you expect to see?
I think
user.Current()
on Unix/Linux, should still create a user object if it finds a userid, even though it has no other information about it, and not fail.Feel free (of course) to close this issue if you think it fails by design.
The text was updated successfully, but these errors were encountered: