|
|
@@ -682,8 +682,13 @@ func (r *Registry) listECRImages(repoName string, repo repository.Repository) ([
|
|
|
|
|
|
svc := ecr.New(sess)
|
|
|
|
|
|
+ maxResults := int64(1000)
|
|
|
+
|
|
|
+ var imageIDs []*ecr.ImageIdentifier
|
|
|
+
|
|
|
resp, err := svc.ListImages(&ecr.ListImagesInput{
|
|
|
RepositoryName: &repoName,
|
|
|
+ MaxResults: &maxResults,
|
|
|
})
|
|
|
|
|
|
if err != nil {
|
|
|
@@ -694,9 +699,28 @@ func (r *Registry) listECRImages(repoName string, repo repository.Repository) ([
|
|
|
return []*ptypes.Image{}, nil
|
|
|
}
|
|
|
|
|
|
+ imageIDs = append(imageIDs, resp.ImageIds...)
|
|
|
+
|
|
|
+ nextToken := resp.NextToken
|
|
|
+
|
|
|
+ for nextToken != nil {
|
|
|
+ resp, err := svc.ListImages(&ecr.ListImagesInput{
|
|
|
+ RepositoryName: &repoName,
|
|
|
+ MaxResults: &maxResults,
|
|
|
+ })
|
|
|
+
|
|
|
+ if err != nil {
|
|
|
+ return nil, err
|
|
|
+ }
|
|
|
+
|
|
|
+ imageIDs = append(imageIDs, resp.ImageIds...)
|
|
|
+ nextToken = resp.NextToken
|
|
|
+ }
|
|
|
+
|
|
|
describeResp, err := svc.DescribeImages(&ecr.DescribeImagesInput{
|
|
|
RepositoryName: &repoName,
|
|
|
- ImageIds: resp.ImageIds,
|
|
|
+ MaxResults: &maxResults,
|
|
|
+ ImageIds: imageIDs,
|
|
|
})
|
|
|
|
|
|
if err != nil {
|
|
|
@@ -705,11 +729,12 @@ func (r *Registry) listECRImages(repoName string, repo repository.Repository) ([
|
|
|
|
|
|
imageDetails := describeResp.ImageDetails
|
|
|
|
|
|
- nextToken := describeResp.NextToken
|
|
|
+ nextToken = describeResp.NextToken
|
|
|
|
|
|
for nextToken != nil {
|
|
|
describeResp, err := svc.DescribeImages(&ecr.DescribeImagesInput{
|
|
|
RepositoryName: &repoName,
|
|
|
+ MaxResults: &maxResults,
|
|
|
ImageIds: resp.ImageIds,
|
|
|
})
|
|
|
|
|
|
@@ -877,10 +902,31 @@ func (r *Registry) listDOCRImages(
|
|
|
|
|
|
name := urlArr[1]
|
|
|
|
|
|
- tags, _, err := client.Registry.ListRepositoryTags(context.TODO(), name, repoName, &godo.ListOptions{})
|
|
|
+ var tags []*godo.RepositoryTag
|
|
|
+ opt := &godo.ListOptions{
|
|
|
+ PerPage: 200,
|
|
|
+ }
|
|
|
+
|
|
|
+ for {
|
|
|
+ nextTags, resp, err := client.Registry.ListRepositoryTags(context.TODO(), name, repoName, opt)
|
|
|
|
|
|
- if err != nil {
|
|
|
- return nil, err
|
|
|
+ if err != nil {
|
|
|
+ return nil, err
|
|
|
+ }
|
|
|
+
|
|
|
+ tags = append(tags, nextTags...)
|
|
|
+
|
|
|
+ if resp.Links == nil || resp.Links.IsLastPage() {
|
|
|
+ break
|
|
|
+ }
|
|
|
+
|
|
|
+ page, err := resp.Links.CurrentPage()
|
|
|
+
|
|
|
+ if err != nil {
|
|
|
+ return nil, err
|
|
|
+ }
|
|
|
+
|
|
|
+ opt.Page = page + 1
|
|
|
}
|
|
|
|
|
|
res := make([]*ptypes.Image, 0)
|