fix image delete error

This commit is contained in:
2026-04-14 16:26:33 +02:00
parent 23f767a866
commit cb2bc53b77
2 changed files with 31 additions and 32 deletions
+2 -8
View File
@@ -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
}