Use fluxcd/pkg/oci/client

Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
This commit is contained in:
Stefan Prodan 2022-08-03 12:55:50 +03:00
parent 08401f62b2
commit 7c7e76f9f0
No known key found for this signature in database
GPG key ID: 3299AEB0E4085BAF
21 changed files with 88 additions and 972 deletions

View file

@ -19,9 +19,12 @@ package main
import (
"context"
"fmt"
"github.com/fluxcd/flux2/internal/oci"
"github.com/fluxcd/flux2/pkg/printers"
"github.com/spf13/cobra"
oci "github.com/fluxcd/pkg/oci/client"
"github.com/fluxcd/flux2/pkg/printers"
)
var listArtifactsCmd = &cobra.Command{
@ -48,12 +51,13 @@ func listArtifactsCmdRun(cmd *cobra.Command, args []string) error {
ctx, cancel := context.WithTimeout(context.Background(), rootArgs.timeout)
defer cancel()
ociClient := oci.NewLocalClient()
url, err := oci.ParseArtifactURL(ociURL)
if err != nil {
return err
}
metas, err := oci.List(ctx, url)
metas, err := ociClient.List(ctx, url)
if err != nil {
return err
}
@ -69,5 +73,4 @@ func listArtifactsCmdRun(cmd *cobra.Command, args []string) error {
}
return nil
}