Merge pull request #7456 from yuanshuhan/replication_ng

fix a small issue, that if there is no manifest in huawei image repos…
This commit is contained in:
Wenkai Yin 2019-04-26 11:27:40 +08:00 committed by GitHub
commit 3c1be645bf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -98,6 +98,9 @@ func (a *adapter) ManifestExist(repository, reference string) (exist bool, diges
defer resp.Body.Close()
code := resp.StatusCode
if code >= 300 || code < 200 {
if code == 404 {
return false, digest, nil
}
body, _ := ioutil.ReadAll(resp.Body)
return exist, digest, fmt.Errorf("[%d][%s]", code, string(body))
}