fix image delete error
This commit is contained in:
@@ -13,13 +13,7 @@ import (
|
||||
)
|
||||
|
||||
func (cli *Client) DeleteImage(ctx context.Context, rawrepo string) (bool, error) {
|
||||
var err error
|
||||
var exist bool
|
||||
ref, err := NewReferer(rawrepo)
|
||||
if err != nil {
|
||||
return exist, err
|
||||
}
|
||||
return cli.DeleteManifest(ctx, ref.ManifestEP())
|
||||
return cli.DeleteManifest(ctx, rawrepo)
|
||||
}
|
||||
|
||||
func (cli *Client) DeleteManifest(ctx context.Context, rawrepo string) (bool, error) {
|
||||
@@ -45,7 +39,7 @@ func (cli *Client) DeleteManifest(ctx context.Context, rawrepo string) (bool, er
|
||||
if resp.StatusCode == http.StatusNotFound {
|
||||
return exist, err
|
||||
}
|
||||
if resp.StatusCode != http.StatusOK {
|
||||
if resp.StatusCode != http.StatusAccepted {
|
||||
err := fmt.Errorf("Unxected response code %s", resp.Status)
|
||||
return exist, err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user