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

Charmcraft 3 should still accept image digests for upload-resource #1953

Open
lengau opened this issue Oct 10, 2024 · 1 comment
Open

Charmcraft 3 should still accept image digests for upload-resource #1953

lengau opened this issue Oct 10, 2024 · 1 comment
Labels
Bug Something isn't working triaged

Comments

@lengau
Copy link
Collaborator

lengau commented Oct 10, 2024

Bug Description

Charmcraft 3 doesn't accept digests, just image IDs, when uploading a resource.

Solution: Reimplement this method on the ImageService. It can use Docker's images.list() method and find the digest under image.attrs["RepoDigests"]. Note that these digests are in <name>@<hash-algo>:<hash> form, so you'll need to check if it matches a regex something like ".+@([a-z0-9]+:)?{digest}" (so it works with just the hash or algo:hash).

To Reproduce

See: https://discourse.charmhub.io/t/publish-your-charm-on-charmhub/12281/6?u=lengau

Environment

n/a

charmcraft.yaml

n/a

Relevant log output

$ charmcraft upload-resource loki-worker-k8s loki-image --image=sha256:583ddc10f52bb4fe4806baa05ecbaa2a3246238f1423bd2a6c35b02fd87b446c
Unknown OCI image reference.                                                                                                                 
Recommended resolution: Pass a valid container transport string.                                                                             
Full execution log: '/home/jose/.local/state/charmcraft/log/charmcraft-20240801-171905.784405.log'
@lengau lengau added Bug Something isn't working triaged labels Oct 10, 2024
Copy link

Thank you for reporting us your feedback!

The internal ticket has been created: https://warthogs.atlassian.net/browse/CRAFT-3564.

This message was autogenerated

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

No branches or pull requests

1 participant