mirror of
https://github.com/fluxcd/flux2.git
synced 2026-05-06 01:54:43 +00:00
Use fluxcd/pkg/oci/client
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
This commit is contained in:
parent
08401f62b2
commit
7c7e76f9f0
21 changed files with 88 additions and 972 deletions
|
|
@ -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
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue