mirror of
https://github.com/project-zot/zot.git
synced 2026-06-17 04:48:26 +08:00
feat(cli): updated display format for multiarch images (#1268)
Signed-off-by: Laurentiu Niculae <niculae.laurentiu1@gmail.com>
This commit is contained in:
@@ -13,6 +13,7 @@ import (
|
||||
"testing"
|
||||
|
||||
"github.com/gorilla/mux"
|
||||
godigest "github.com/opencontainers/go-digest"
|
||||
ispec "github.com/opencontainers/image-spec/specs-go/v1"
|
||||
. "github.com/smartystreets/goconvey/convey"
|
||||
|
||||
@@ -264,6 +265,7 @@ func TestDoHTTPRequest(t *testing.T) {
|
||||
vars := mux.Vars(req)
|
||||
|
||||
if vars["reference"] == "indexRef" {
|
||||
writer.Header().Add("docker-content-digest", godigest.FromString("t").String())
|
||||
_, err := writer.Write([]byte(`
|
||||
{
|
||||
"manifests": [
|
||||
@@ -592,6 +594,7 @@ func TestDoJobErrors(t *testing.T) {
|
||||
Route: "/v2/{name}/manifests/{reference}",
|
||||
HandlerFunc: func(w http.ResponseWriter, r *http.Request) {
|
||||
w.Header().Add("Content-Type", ispec.MediaTypeImageIndex)
|
||||
w.Header().Add("docker-content-digest", godigest.FromString("t").String())
|
||||
|
||||
_, err := w.Write([]byte(""))
|
||||
if err != nil {
|
||||
@@ -606,6 +609,8 @@ func TestDoJobErrors(t *testing.T) {
|
||||
vars := mux.Vars(req)
|
||||
|
||||
if vars["reference"] == "indexRef" {
|
||||
writer.Header().Add("docker-content-digest", godigest.FromString("t").String())
|
||||
|
||||
_, err := writer.Write([]byte(`{"manifests": [{"digest": "manifestRef"}]}`))
|
||||
if err != nil {
|
||||
return
|
||||
@@ -613,6 +618,8 @@ func TestDoJobErrors(t *testing.T) {
|
||||
}
|
||||
|
||||
if vars["reference"] == "manifestRef" {
|
||||
writer.Header().Add("docker-content-digest", godigest.FromString("t").String())
|
||||
|
||||
_, err := writer.Write([]byte(`{"config": {"digest": "confDigest"}}`))
|
||||
if err != nil {
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user