update delete

Signed-off-by: Jess Frazelle <acidburn@microsoft.com>
This commit is contained in:
Jess Frazelle 2017-12-18 15:17:27 -05:00
parent c1c2894c74
commit d57e019b47
No known key found for this signature in database
GPG key ID: 18F3685C0022BFF3
2 changed files with 6 additions and 1 deletions

View file

@ -16,6 +16,11 @@ func (r *Registry) Delete(repository, ref string) error {
return err
}
// If we couldn't get the digest because it was not found just try and delete the ref they passed.
if digest == "" {
digest = ref
}
// Delete the image.
url := r.url("/v2/%s/manifests/%s", repository, digest)
r.Logf("registry.manifests.delete url=%s repository=%s ref=%s",

View file

@ -25,7 +25,7 @@ func (r *Registry) Digest(repository, ref string) (string, error) {
}
defer resp.Body.Close()
if resp.StatusCode != http.StatusOK {
if resp.StatusCode != http.StatusOK && resp.StatusCode != http.StatusNotFound {
return "", fmt.Errorf("Got status code: %d", resp.StatusCode)
}