Merge pull request #2050 from tonistiigi/token-seed

authprovider: allow errors on seed unmarshal
v0.9
Akihiro Suda 2021-03-30 14:33:18 +09:00 committed by GitHub
commit fa5d295a06
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 3 deletions

View File

@ -53,9 +53,8 @@ func (ts *tokenSeeds) getSeed(host string) ([]byte, error) {
return nil, err
}
} else {
if err := json.Unmarshal(dt, &ts.m); err != nil {
return nil, errors.Wrapf(err, "failed to parse %s", fp)
}
// ignore error in case of crash during previous marshal
_ = json.Unmarshal(dt, &ts.m)
}
v, ok := ts.m[host]
if !ok {