@@ -157,7 +157,7 @@ func (cli *RegistryClient) IsLoggedIn() bool {
157
157
return cli .Token != nil
158
158
}
159
159
160
- func decodeTagData (body io.ReadCloser ) ([]string , map [string ]manifest.Manifest , error ) {
160
+ func decodeAllTagData (body io.ReadCloser ) ([]string , map [string ]manifest.Manifest , error ) {
161
161
tagData := struct {
162
162
TagNames []string `json:"tags"`
163
163
RawManifests map [string ]manifest.Raw `json:"manifest,omitempty"`
@@ -204,8 +204,21 @@ func (cli *RegistryClient) repoToken(repoPath string) (auth.Token, error) {
204
204
return cli .RepoTokens [repoPath ], nil
205
205
}
206
206
207
- // TagData gets list of all tag names and all additional data for the repository path specified
208
- func (cli * RegistryClient ) TagData (repoPath string ) ([]string , map [string ]manifest.Manifest , error ) {
207
+ // TagData gets data of either all tags (list+get) or a set of single tags only (blind "get")
208
+ func (cli * RegistryClient ) TagData (
209
+ repoPath string ,
210
+ isSingle bool ,
211
+ repoTags []string ,
212
+ ) ([]string , map [string ]manifest.Manifest , error ) {
213
+ if isSingle {
214
+ return cli .SingleTagData (repoTags )
215
+ }
216
+
217
+ return cli .AllTagData (repoPath )
218
+ }
219
+
220
+ // AllTagData gets list of all tag names and all additional data for the repository path specified
221
+ func (cli * RegistryClient ) AllTagData (repoPath string ) ([]string , map [string ]manifest.Manifest , error ) {
209
222
repoToken , err := cli .repoToken (repoPath )
210
223
if err != nil {
211
224
return nil , nil , err
@@ -228,7 +241,7 @@ func (cli *RegistryClient) TagData(repoPath string) ([]string, map[string]manife
228
241
return nil , nil , err
229
242
}
230
243
231
- tagNames , tagManifests , err := decodeTagData (resp .Body )
244
+ tagNames , tagManifests , err := decodeAllTagData (resp .Body )
232
245
if err != nil {
233
246
return nil , nil , err
234
247
}
@@ -246,6 +259,17 @@ func (cli *RegistryClient) TagData(repoPath string) ([]string, map[string]manife
246
259
return allTagNames , allTagManifests , nil
247
260
}
248
261
262
+ // SingleTagData gets data for a set of single tags
263
+ func (cli * RegistryClient ) SingleTagData (repoTags []string ) ([]string , map [string ]manifest.Manifest , error ) {
264
+ tagManifests := make (map [string ]manifest.Manifest )
265
+
266
+ for _ , tagName := range repoTags {
267
+ tagManifests [tagName ] = manifest.Manifest {}
268
+ }
269
+
270
+ return repoTags , tagManifests , nil
271
+ }
272
+
249
273
func (cli * RegistryClient ) tagDigest (repoPath , tagName string ) (string , error ) {
250
274
repoToken , err := cli .repoToken (repoPath )
251
275
if err != nil {
0 commit comments