working commit

This commit is contained in:
2026-03-17 14:56:35 +02:00
parent 97904e0529
commit 52789ef4d1
26 changed files with 1334 additions and 52 deletions
+9 -8
View File
@@ -43,24 +43,25 @@ func (util *ImageUtil) imageManifest(common *CommonImageParams, params *ImageMan
Index: &ocispec.Index{},
Manifest: &ocispec.Manifest{},
}
params.Imagepath, err = packUserinfo(params.Imagepath, common.Username, common.Password)
if err != nil {
return res, err
}
timeout := time.Duration(common.Timeout) * time.Second
ctx, _ := context.WithTimeout(context.Background(), timeout)
ref, err := repocli.NewReferer(params.Imagepath)
if err != nil {
return res, err
}
ref.SetUserinfo(common.Username, common.Password)
mw := repocli.NewBasicAuthMiddleware(ref.Userinfo())
cli := repocli.NewClient(nil, mw)
exists, mime, man, _, err := cli.GetRawManifest(ctx, ref.RawRepo())
if !exists {
err = fmt.Errorf("Manifest not found")
accepts := []string{
repocli.MediaTypeDDMLv2,
repocli.MediaTypeDDMv2,
repocli.MediaTypeOIMv1,
repocli.MediaTypeOIIv1,
}
_, mime, man, _, err := cli.GetRawManifest(ctx, ref.Raw(), accepts)
if err != nil {
return res, err
}
switch mime {
case repocli.MediaTypeDDMLv2, repocli.MediaTypeOIIv1: