working commit
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
package repocli
|
||||
|
||||
import (
|
||||
"github.com/stretchr/testify/require"
|
||||
|
||||
"bytes"
|
||||
"context"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"testing"
|
||||
"time"
|
||||
)
|
||||
|
||||
func xxxTestClientGetManifest(t *testing.T) {
|
||||
rawrepo := "mirror.gcr.io/alpine"
|
||||
tags := []string{
|
||||
"3.20.0",
|
||||
"sha256:29e5ba63e79337818e6c63cfcc68e2ab4e9ca483853b2de303bfbfba9372426c",
|
||||
}
|
||||
for _, tag := range tags {
|
||||
cli := NewClient()
|
||||
ctx, _ := context.WithTimeout(context.Background(), 10*time.Second)
|
||||
exist, mime, man, err := cli.GetManifest(ctx, rawrepo, tag)
|
||||
require.NoError(t, err)
|
||||
require.True(t, exist)
|
||||
|
||||
fmt.Printf("Type: %s\n", mime)
|
||||
buffer := bytes.NewBuffer(nil)
|
||||
err = json.Indent(buffer, man, " ", " ")
|
||||
require.NoError(t, err)
|
||||
//fmt.Printf("%s\n", buffer.String())
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user