pkg: idtools: fix subid files parsing
Since Docker is already skipping newlines in /etc/sub{uid,gid}, this patch skips commented out lines - otherwise Docker fails to start. Add unit test also. Signed-off-by: Antonio Murdaca <runcom@redhat.com>
This commit is contained in:
parent
366b774b47
commit
7e132eee02
2 changed files with 29 additions and 1 deletions
|
@ -171,7 +171,7 @@ func parseSubidFile(path, username string) (ranges, error) {
|
|||
}
|
||||
|
||||
text := strings.TrimSpace(s.Text())
|
||||
if text == "" {
|
||||
if text == "" || strings.HasPrefix(text, "#") {
|
||||
continue
|
||||
}
|
||||
parts := strings.Split(text, ":")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue