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

crane: Deleting image by tag not working #1822

Closed
iFrozenPhoenix opened this issue Oct 24, 2023 · 9 comments
Closed

crane: Deleting image by tag not working #1822

iFrozenPhoenix opened this issue Oct 24, 2023 · 9 comments
Labels
bug Something isn't working

Comments

@iFrozenPhoenix
Copy link

Describe the bug

Deleting a tag, i.e. the manifest and the blob, is not working when using crane delete registry.domain/repo/image:tag

To Reproduce

crane delete registry.domain/repo/image:tag

Expected behavior

when the delete command is specified with a tag instead of a digest the tag is automatically resolved to the digest value and the delete command is executed with the digest.

Additional context

Add any other context about the problem here.
Registry: Distribution

@iFrozenPhoenix iFrozenPhoenix added the bug Something isn't working label Oct 24, 2023
Copy link

This issue is stale because it has been open for 90 days with no
activity. It will automatically close after 30 more days of
inactivity. Keep fresh with the 'lifecycle/frozen' label.

@megamorf
Copy link

megamorf commented Feb 8, 2024

I'm also facing this issue. I ran crane ls, did some grep magic and piped the output to xargs ... | xargs -I % crane delete "${REGISTRY}/${NAMESPACE}/${PROJECT}:%" but get invalid checksum digest format.

The help text does not indicate that a digest is expected and just like OP said I'd expect crane to resolve the tag accordingly:

▶ crane delete --help
Delete an image reference from its registry

Usage:
  crane delete IMAGE [flags]

Flags:
  -h, --help   help for delete

Global Flags:
      --allow-nondistributable-artifacts   Allow pushing non-distributable (foreign) layers
      --insecure                           Allow image references to be fetched without TLS
      --platform platform                  Specifies the platform in the form os/arch[/variant][:osversion] (e.g. linux/amd64). (default all)
  -v, --verbose                            Enable debug logs

@sankalp-khare
Copy link

@iFrozenPhoenix could you share the output when you try this? thanks!

@iFrozenPhoenix
Copy link
Author

@sankalp-khare the error was something that the hash couldn't be found. Actually I can't reproduce it anymore.
Deleting a tag is now actually working. Can't say if it was a problem of the registry (distributon) or crane.

@megamorf
Copy link

@sankalp-khare the error was something that the hash couldn't be found. Actually I can't reproduce it anymore.
Deleting a tag is now actually working. Can't say if it was a problem of the registry (distributon) or crane.

Can you add the crane version that you tested with so that I can check as well :-)

@iFrozenPhoenix
Copy link
Author

Sure, 0.19.0

@testwill
Copy link

crane delete x.x.x.x::443/my_test/ubuntu18.04:php7.2.10 --insecure

goroutine 9 [running]:
runtime/debug.Stack()
/usr/local/go/src/runtime/debug/stack.go:24 +0x65
runtime/debug.PrintStack()
/usr/local/go/src/runtime/debug/stack.go:16 +0x19
github.com/google/go-containerregistry/pkg/v1/remote/transport.pickFromMultipleChallenges({0xc000014978, 0x1, 0x9a4fe6?})
/home/jack/code/go-containerregistry/pkg/v1/remote/transport/ping.go:174 +0x71
github.com/google/go-containerregistry/pkg/v1/remote/transport.pingSingle({0xa7c2a8?, 0xc00007c690}, {0x0?, {0xc000030450?, 0x0?}}, {0xa77f60, 0xc00003cb00}, {0x9a569d, 0x5})
/home/jack/code/go-containerregistry/pkg/v1/remote/transport/ping.go:90 +0x359
github.com/google/go-containerregistry/pkg/v1/remote/transport.pingParallel.func1({0xa7c2a8?, 0xc00007c690?}, {0x9a569d, 0x5})
/home/jack/code/go-containerregistry/pkg/v1/remote/transport/ping.go:122 +0x7e
created by github.com/google/go-containerregistry/pkg/v1/remote/transport.pingParallel
/home/jack/code/go-containerregistry/pkg/v1/remote/transport/ping.go:136 +0x2d2
bearer
Error: DELETE https://x.x.x.x:443/v2/my_test/ubuntu18.04/manifests/php7.2.10: UNSUPPORTED: unsupported digest php7.2.10: invalid checksum digest format

@testwill
Copy link

v0.19.1

@testwill
Copy link

harbor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants