working commit
This commit is contained in:
@@ -15,7 +15,7 @@ import (
|
||||
|
||||
"github.com/spf13/cobra"
|
||||
|
||||
"mstore/pkg/client"
|
||||
"mstore/pkg/repocli"
|
||||
)
|
||||
|
||||
// CatalogImages
|
||||
@@ -38,17 +38,16 @@ func (util *ImageUtil) catalogImages(common *CommonImageParams, params *CatalogI
|
||||
res := &CatalogImagesResult{
|
||||
Repositories: make([]string, 0),
|
||||
}
|
||||
ctx := context.Background()
|
||||
|
||||
cli := client.NewClient(common.SkipTLSVerify)
|
||||
timeout := time.Duration(common.Timeout) * time.Second
|
||||
ctx, _ := context.WithTimeout(context.Background(), timeout)
|
||||
|
||||
params.Source, err = packUserinfo(params.Source, common.Username, common.Password)
|
||||
ref, err := repocli.NewReferer(params.Source)
|
||||
if err != nil {
|
||||
return res, err
|
||||
}
|
||||
ctx, _ = context.WithTimeout(ctx, timeout)
|
||||
opres, err := cli.CatalogImages(ctx, params.Source)
|
||||
mw := repocli.NewBasicAuthMiddleware(ref.Userinfo())
|
||||
cli := repocli.NewClient(nil, mw)
|
||||
opres, err := cli.GetCatalog(ctx, ref.Raw())
|
||||
if err != nil {
|
||||
return res, err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user