@@ -142,6 +142,22 @@ func Repository() *Command {
142
142
RunListRepositories , "list" ,
143
143
"List repositories for a container registry" , listRepositoriesDesc ,
144
144
Writer , aliasOpt ("ls" ), displayerType (& displayers.Repository {}),
145
+ hiddenCmd (),
146
+ )
147
+
148
+ listRepositoriesV2Desc := `This command retrieves information about repositories in a registry, including:
149
+ - The repository name
150
+ - The latest manifest of the repository
151
+ - The latest manifest's latest tag, if any
152
+ - The number of tags in the repository
153
+ - The number of manifests in the repository
154
+ `
155
+
156
+ CmdBuilder (
157
+ cmd ,
158
+ RunListRepositoriesV2 , "list-v2" ,
159
+ "List repositories for a container registry" , listRepositoriesV2Desc ,
160
+ Writer , aliasOpt ("ls2" ), displayerType (& displayers.Repository {}),
145
161
)
146
162
147
163
listRepositoryTagsDesc := `This command retrieves information about tags in a repository, including:
@@ -169,6 +185,21 @@ func Repository() *Command {
169
185
)
170
186
AddBoolFlag (cmdRunRepositoryDeleteTag , doctl .ArgForce , doctl .ArgShortForce , false , "Force tag deletion" )
171
187
188
+ listRepositoryManifests := `This command retrieves information about manifests in a repository, including:
189
+ - The manifest digest
190
+ - The compressed size
191
+ - The uncompressed size
192
+ - The last updated timestamp
193
+ - The manifest tags
194
+ - The manifest blobs (available in detailed output only)
195
+ `
196
+ CmdBuilder (
197
+ cmd ,
198
+ RunListRepositoryManifests , "list-manifests <repository>" ,
199
+ "List manifests for a repository in a container registry" , listRepositoryManifests ,
200
+ Writer , aliasOpt ("lm" ), displayerType (& displayers.RepositoryManifest {}),
201
+ )
202
+
172
203
deleteManifestDesc := "This command permanently deletes one or more repository manifests by digest."
173
204
cmdRunRepositoryDeleteManifest := CmdBuilder (
174
205
cmd ,
@@ -537,6 +568,21 @@ func RunListRepositories(c *CmdConfig) error {
537
568
return displayRepositories (c , repositories ... )
538
569
}
539
570
571
+ // RunListRepositoriesV2 lists repositories for the registry
572
+ func RunListRepositoriesV2 (c * CmdConfig ) error {
573
+ registry , err := c .Registry ().Get ()
574
+ if err != nil {
575
+ return fmt .Errorf ("failed to get registry: %w" , err )
576
+ }
577
+
578
+ repositories , err := c .Registry ().ListRepositoriesV2 (registry .Name )
579
+ if err != nil {
580
+ return err
581
+ }
582
+
583
+ return displayRepositoriesV2 (c , repositories ... )
584
+ }
585
+
540
586
// RunListRepositoryTags lists tags for the repository in a registry
541
587
func RunListRepositoryTags (c * CmdConfig ) error {
542
588
err := ensureOneArg (c )
@@ -557,6 +603,26 @@ func RunListRepositoryTags(c *CmdConfig) error {
557
603
return displayRepositoryTags (c , tags ... )
558
604
}
559
605
606
+ // RunListRepositoryManifests lists manifests for the repository in a registry
607
+ func RunListRepositoryManifests (c * CmdConfig ) error {
608
+ err := ensureOneArg (c )
609
+ if err != nil {
610
+ return err
611
+ }
612
+
613
+ registry , err := c .Registry ().Get ()
614
+ if err != nil {
615
+ return fmt .Errorf ("failed to get registry: %w" , err )
616
+ }
617
+
618
+ manifests , err := c .Registry ().ListRepositoryManifests (registry .Name , c .Args [0 ])
619
+ if err != nil {
620
+ return err
621
+ }
622
+
623
+ return displayRepositoryManifests (c , manifests ... )
624
+ }
625
+
560
626
// RunRepositoryDeleteTag deletes one or more repository tags
561
627
func RunRepositoryDeleteTag (c * CmdConfig ) error {
562
628
force , err := c .Doit .GetBool (c .NS , doctl .ArgForce )
@@ -645,13 +711,27 @@ func displayRepositories(c *CmdConfig, repositories ...do.Repository) error {
645
711
return c .Display (item )
646
712
}
647
713
714
+ func displayRepositoriesV2 (c * CmdConfig , repositories ... do.RepositoryV2 ) error {
715
+ item := & displayers.RepositoryV2 {
716
+ Repositories : repositories ,
717
+ }
718
+ return c .Display (item )
719
+ }
720
+
648
721
func displayRepositoryTags (c * CmdConfig , tags ... do.RepositoryTag ) error {
649
722
item := & displayers.RepositoryTag {
650
723
Tags : tags ,
651
724
}
652
725
return c .Display (item )
653
726
}
654
727
728
+ func displayRepositoryManifests (c * CmdConfig , manifests ... do.RepositoryManifest ) error {
729
+ item := & displayers.RepositoryManifest {
730
+ Manifests : manifests ,
731
+ }
732
+ return c .Display (item )
733
+ }
734
+
655
735
// Garbage Collection run commands
656
736
657
737
// RunStartGarbageCollection starts a garbage collection for the specified
0 commit comments