Skip to content

Commit

Permalink
Add more information in errors about missing uidimappings or gidmappings
Browse files Browse the repository at this point in the history
Need to tell users about the files that the mappings are missing in.

No subuid ranges found for user "dwalsh" in /etc/subuid

Signed-off-by: Daniel J Walsh <[email protected]>
  • Loading branch information
rhatdan committed Jul 30, 2018
1 parent 956a197 commit ad12a70
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/idtools/idtools.go
Original file line number Diff line number Diff line change
Expand Up @@ -140,10 +140,10 @@ func NewIDMappings(username, groupname string) (*IDMappings, error) {
return nil, err
}
if len(subuidRanges) == 0 {
return nil, fmt.Errorf("No subuid ranges found for user %q", username)
return nil, fmt.Errorf("No subuid ranges found for user %q in %s", username, subuidFileName)
}
if len(subgidRanges) == 0 {
return nil, fmt.Errorf("No subgid ranges found for group %q", groupname)
return nil, fmt.Errorf("No subgid ranges found for group %q in %s", groupname, subgidFileName)
}

return &IDMappings{
Expand Down

0 comments on commit ad12a70

Please sign in to comment.