repocli: first version of pull & push image

This commit is contained in:
2026-03-10 21:19:19 +02:00
parent f85cda868a
commit 9bc3b77144
13 changed files with 61 additions and 90 deletions
+3 -2
View File
@@ -11,7 +11,7 @@ import (
"time"
)
func xxxTestClientGetManifest(t *testing.T) {
func TestClientGetManifest(t *testing.T) {
rawrepo := "mirror.gcr.io/alpine"
tags := []string{
"3.20.0",
@@ -20,11 +20,12 @@ func xxxTestClientGetManifest(t *testing.T) {
for _, tag := range tags {
cli := NewClient(nil, nil)
ctx, _ := context.WithTimeout(context.Background(), 10*time.Second)
exist, mime, man, err := cli.GetRawManifest(ctx, rawrepo+":"+tag)
exist, mime, man, digstr, err := cli.GetRawManifest(ctx, rawrepo+":"+tag)
require.NoError(t, err)
require.True(t, exist)
fmt.Printf("Type: %s\n", mime)
fmt.Printf("Digest: %s\n", digstr)
buffer := bytes.NewBuffer(nil)
err = json.Indent(buffer, man, " ", " ")
require.NoError(t, err)