parseUserFromImageUser splits the user out of an user:group string.
(id string)
| 237 | |
| 238 | // parseUserFromImageUser splits the user out of an user:group string. |
| 239 | func 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. |
no outgoing calls
no test coverage detected
searching dependent graphs…