Skip to content
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

Deleting using 'tags-like' keeps digest, not removing tag #89

Open
PBXg33k opened this issue Mar 18, 2020 · 2 comments
Open

Deleting using 'tags-like' keeps digest, not removing tag #89

PBXg33k opened this issue Mar 18, 2020 · 2 comments

Comments

@PBXg33k
Copy link

PBXg33k commented Mar 18, 2020

We're trying to use this tool to keep our internal registry clean using our CI/CD infrastructure, but i seem to be unable to delete tags from our registry.

Our CI build images and pushes these to the registry, upon build only one tag is used based on the branch name, so we can exclude that digest are referenced by multiple tags.

I would expect the tool to delete the unused/untagged digest since it's not refered by any other tag than the one we have pushed from CI.

% docker run --rm anoxis/registry-cli -r $REGISTRY_URL --delete --num 0 --tags-like "feature-tag" "feature-tag-frontend"
Will delete all but 0 last tags
---------------------------------
Image: some-product
tag like: feature-tag
Adding feature-tag to tags list
tag like: feature-tag-frontend
  tag: feature-tag
Getting digests for tags to keep:
Getting digest for tag feature-tag
Keep digest sha256:474edf4ac40cd07c1bb225dd9cb4c75b9272b8b7fe2994233e3e1e57ee0e7c91 for tag feature-tag
---------------------------------
Image: some-product-frontend
tag like: feature-tag
Adding feature-tag to tags list
tag like: feature-tag-frontend
  tag: feature-tag
Getting digests for tags to keep:
Getting digest for tag feature-tag
Keep digest sha256:bc01bede6ca516d98eb26914a3a8f5ea40c86029eb863a9d70bd4b9888793f00 for tag feature-tag

Am i executing the script incorrectly or is this a bug?

Registry is running on the registry:2.7.1 image.

@andrey-pohilko
Copy link
Owner

andrey-pohilko commented Mar 19, 2020 via email

@PBXg33k
Copy link
Author

PBXg33k commented Mar 19, 2020

I'm not expecting orphaned digest to be created, i just wanted to doublecheck and explicitly mentioned that the created layers are only referenced by a single tag, and removing that that would render them orphaned.

Running the same command without --num or --num having a non-zero value generates the same output, and not deleting the tag given to --tags-like

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

No branches or pull requests

2 participants