mirror of
https://github.com/linuxkit/linuxkit.git
synced 2025-07-21 10:09:07 +00:00
metadata: Fix parsing of JSON
`ok` was not assigned when type casting to `map[string]interface{}` so the subsequent check was testing a stale value. Also, the error message upon failure had the wrong sense. Signed-off-by: Ian Campbell <ian.campbell@docker.com>
This commit is contained in:
parent
e0bcac3a28
commit
8fd1a3cbdb
@ -167,9 +167,9 @@ func processUserData(data []byte) error {
|
||||
continue
|
||||
}
|
||||
for f, i := range files {
|
||||
fi := i.(map[string]interface{})
|
||||
fi, ok := i.(map[string]interface{})
|
||||
if !ok {
|
||||
log.Printf("Could convert JSON for items: %s", i)
|
||||
log.Printf("Couldn't convert JSON for items: %s", i)
|
||||
continue
|
||||
}
|
||||
if _, ok := fi["perm"]; !ok {
|
||||
|
Loading…
Reference in New Issue
Block a user