mirror of
https://github.com/containers/image.git
synced 2025-04-18 19:44:05 +03:00
Validate the tags returned by a registry
Signed-off-by: Miloslav Trmač <mitr@redhat.com>
This commit is contained in:
parent
1b9415b7eb
commit
4b2d28a409
@ -88,7 +88,12 @@ func GetRepositoryTags(ctx context.Context, sys *types.SystemContext, ref types.
|
||||
if err = json.NewDecoder(res.Body).Decode(&tagsHolder); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
tags = append(tags, tagsHolder.Tags...)
|
||||
for _, tag := range tagsHolder.Tags {
|
||||
if _, err := reference.WithTag(dr.ref, tag); err != nil { // Ensure the tag does not contain unexpected values
|
||||
return nil, fmt.Errorf("registry returned invalid tag %q: %w", tag, err)
|
||||
}
|
||||
tags = append(tags, tag)
|
||||
}
|
||||
|
||||
link := res.Header.Get("Link")
|
||||
if link == "" {
|
||||
|
Loading…
x
Reference in New Issue
Block a user