image: fixed tags, catalog, push operation

This commit is contained in:
2026-03-11 21:02:10 +02:00
parent a064d942e7
commit 0d67944966
9 changed files with 25 additions and 18 deletions
+1 -1
View File
@@ -20,7 +20,7 @@ func (cli *Client) CreateAccount(ctx context.Context, host, user, pass string) (
if err != nil {
return res, err
}
respdata, err := cli.doHTTPCall(ctx, host, "accont", "create", reqdata)
respdata, err := cli.doHTTPCall(ctx, host, "account", "create", reqdata)
if err != nil {
return res, err
}
+3 -3
View File
@@ -105,11 +105,11 @@ func Unarchive(filename, dstdir string) error {
target = filepath.Clean(target)
fileInfo := header.FileInfo()
switch header.Typeflag {
case tar.TypeDir:
_, err := os.Stat(target)
if err != nil && err == os.ErrNotExist {
if os.IsNotExist(err) {
err = nil
err := os.MkdirAll(target, fileInfo.Mode())
if err != nil {
return err
@@ -122,7 +122,7 @@ func Unarchive(filename, dstdir string) error {
wrapfunc := func() error {
dir := filepath.Dir(target)
_, err := os.Stat(dir)
if err != nil && err == os.ErrNotExist {
if os.IsNotExist(err) {
err := os.MkdirAll(dir, 0750)
if err != nil {
return err
+1 -1
View File
@@ -73,7 +73,7 @@ func (cli *Client) PushImage(ctx context.Context, filepath, imagepath string) er
dstdir := auxtool.MakeTmpFilename(filepath)
err = auxutar.Unarchive(filepath, dstdir)
if err != nil {
os.RemoveAll(dstdir)
//os.RemoveAll(dstdir)
return err
}
image, err := imageLoader(dstdir)
+6 -2
View File
@@ -18,11 +18,15 @@ import (
"fmt"
"net/http"
"strconv"
"mstore/pkg/descr"
)
func (cli *Client) GetTags(ctx context.Context, rawrepo string) ([]string, error) {
func (cli *Client) GetTags(ctx context.Context, rawrepo string) (*descr.Tags, error) {
var err error
list := make([]string, 0)
list := &descr.Tags{
Tags: make([]string, 0),
}
tagdata, err := cli.GetRawTags(ctx, rawrepo)
if err != nil {
return list, err