MCPcopy Create free account
hub / github.com/Mirantis/cri-dockerd / parseUserFromImageUser

Function parseUserFromImageUser

core/image.go:239–249  ·  view source on GitHub ↗

parseUserFromImageUser splits the user out of an user:group string.

(id string)

Source from the content-addressed store, hash-verified

237
238// parseUserFromImageUser splits the user out of an user:group string.
239func parseUserFromImageUser(id string) string {
240 if id == "" {
241 return id
242 }
243 // split instances where the id may contain user:group
244 if strings.Contains(id, ":") {
245 return strings.Split(id, ":")[0]
246 }
247 // no group, just return the id
248 return id
249}
250
251// getUserFromImageUser gets uid or user name of the image user.
252// If user is numeric, it will be treated as uid; or else, it is treated as user name.

Callers 1

getUserFromImageUserFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…