mirror of
https://github.com/fluxcd/flux2.git
synced 2026-05-05 09:38:50 +00:00
Add oci:// prefix
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
This commit is contained in:
parent
adc7981f22
commit
8049634e4d
13 changed files with 100 additions and 23 deletions
|
|
@ -30,7 +30,7 @@ var listArtifactsCmd = &cobra.Command{
|
|||
Long: `The list command fetches the tags and their metadata from a remote OCI repository.
|
||||
The list command uses the credentials from '~/.docker/config.json'.`,
|
||||
Example: `# list the artifacts stored in an OCI repository
|
||||
flux list artifact ghcr.io/org/manifests/app
|
||||
flux list artifact oci://ghcr.io/org/manifests/app
|
||||
`,
|
||||
RunE: listArtifactsCmdRun,
|
||||
}
|
||||
|
|
@ -41,13 +41,18 @@ func init() {
|
|||
|
||||
func listArtifactsCmdRun(cmd *cobra.Command, args []string) error {
|
||||
if len(args) < 1 {
|
||||
return fmt.Errorf("artifact repository is required")
|
||||
return fmt.Errorf("artifact repository URL is required")
|
||||
}
|
||||
url := args[0]
|
||||
ociURL := args[0]
|
||||
|
||||
ctx, cancel := context.WithTimeout(context.Background(), rootArgs.timeout)
|
||||
defer cancel()
|
||||
|
||||
url, err := oci.ParseArtifactURL(ociURL)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
metas, err := oci.List(ctx, url)
|
||||
if err != nil {
|
||||
return err
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue