mirror of
https://github.com/genuinetools/reg.git
synced 2024-05-20 03:58:32 -04:00
update delete
Signed-off-by: Jess Frazelle <acidburn@microsoft.com>
This commit is contained in:
parent
c1c2894c74
commit
d57e019b47
|
@ -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",
|
||||
|
|
|
@ -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)
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue