`charmcraft upload-resource` 2.1.0 removes ability to pass tagged image names to `--image` argument
Metadata
Current evaluation
Closed as solved. Affected teams migrated CI to use image digests instead of tags. Rather than reverting the change, PR #912 was created to improve error messaging when tagged image names are provided.
Suggested action: —
No scores available.
Issue body
`charmcraft` 2.1.0 includes [this fix](https://github.com/canonical/charmcraft/pull/871) which patched a bug with how `charmcraft upload-resource --image ____` handled image ID/digests for uploading oci images. Prior to this patch, `charmcraft upload-resource` would successfully upload images provided by tagged image name (`charmcraft upload-resource --image ubuntu:22.10` worked), but this patch inadvertently blocks this usage because it interprets any input string that includes a `:` as a digest (so `--image ubuntu:22.10` will be interpreted as a digest). [The upload-resource documentation](https://discourse.charmhub.io/t/charmcrafts-upload-resource-command/4580) states that the `--image` flag accepts only the short digest (aka image id) or the long digest (eg: `sha256:...1), and that *it does not accept the image `name:tag`* for uploading oci images, so there was never intent to allow image uploads by tagged name even though it did function that way prior to version 2.1.0
Although the documentation clearly states image should be specified by ID/digest, a large portion of the charming community has interpreted the `--image` argument as a typical named image reference, as is common in other tools in the ecosystem (example: [kubernetes container spec](https://kubernetes.io/docs/reference/kubernetes-api/workload-resources/pod-v1/#image) uses the name `image` and accepts `imagename:tag` or `imagename@digest`). This means that 2.1.0 was a breaking change for anyone who used the tool this way.
At least 2 Canonical teams (~30 charms) had CI that broke from this patch, and [searching Canonical's org for `metadata.yaml` files that reference images by tagged name](https://github.com/search?p=5&q=org%3Acanonical+%22upstream-source%22+filename%3Ametadata.yaml&type=Code) suggests all or nearly all charms are referencing images by tagged name rather than digest. This means it is likely this is an accidental breaking change for others as well.
It would be helpful if this change was reverted (or modified so that tagged images were allowed). If the requirement is to not use tagged image names, a deprecation period seems appropriate given its wide use. It would also be helpful if `charmcraft`'s integration testing include some of the community's charms and tooling so that breaking changes (even if they adhere to the stated behaviour of the tool) are caught before reaching production.
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| qwen3.6-35b-a3b-mtp-q6 | — | — | Closed as solved. Affected teams migrated CI to use image digests instead of tags. Rather than reverting the change, PR #912 was created to improve error messaging when tagged image names are provided. | |
| qwen/qwen3.6-35b-a3b | — | — | Closed without reverting the breaking change. Affected teams migrated CI to pass image digests instead of tags. A separate PR (#912) improves error messaging for tag usage. Maintainers marked the issue as resolved. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Closed as resolved. Affected teams migrated CI to pass image digests instead of tags. Maintainers opened PR #912 to improve error messaging when tagged images are provided. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Closed as resolved. Teams migrated CI to use digests instead of tags. Maintainers declined to revert the change, instead opening PR #912 to improve error messaging when tags are provided. The breaking change remains in place. |
Update history
No update history recorded yet.
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #912 Make explicit that image resources are not uploadable by tag | charmcraft | closed | Superseded by charmcraft 3. The tool now uses explicit --image-id and --image-digest flags, eliminating the ambiguous --image tag handling and resolving the reported UX issue. | |
| #1953 Charmcraft 3 should still accept image digests for `upload-resource` | charmcraft | open | Charmcraft 3 `upload-resource` rejects bare image digests (e.g. sha256:…) that charmcraft 2 accepted; the ImageService lacks a digest-based lookup via RepoDigests. Unlabeled, no maintainer response, only a bot Jira-sync comment. | |
| #444 unable to upload oci-image resource from dockerhub using image digest | charmcraft | closed | Superseded by charmcraft 1.1.1, which replaces remote digest uploads with local image uploads using digests. Closed as the upcoming release resolves the parsing limitation. |