Skip to content

feat(purge): add --untag-limit flag to control maximum untagged manifests in purge operation #458

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ninjadq
Copy link
Member

@ninjadq ninjadq commented Jun 12, 2025

Purpose of the PR

This PR will fix timeout issue when there are very large number of untagged manifest existed in repository.

Fixes #457

@@ -196,6 +196,10 @@ func GetUntaggedManifests(ctx context.Context, acrClient api.AcrCLIClientInterfa
if err != nil {
return nil, err
}
if UntagLimit > 0 && len(candidates) >= UntagLimit {
// If the number of candidates is greater than the limit, we stop fetching more manifests.
break
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Breaking here means only a subset of manifest is scanned. It may cause unwanted purge since any currently dangling manifest might get referenced by a tag in the next iteration.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add a limitation when purge untagged repository
2 participants