← Back to issue list

`charmcraft upload-resource` 2.1.0 removes ability to pass tagged image names to `--image` argument

View original Github issue

Metadata

Project
charmcraft
Number
#906
Type
issue
State
closed
Author
ca-scribner
Labels
—
Created
Updated
Closed

Current evaluation

Tagged-name support was not restored; affected teams migrated to digests. Charmcraft 3.1.0 later replaced legacy image handling with skopeo uploads in #1696.

Resolution: closed not a bug

Reason: The closing maintainer said users were unblocked after migrating to digests, although the outcome was not ideal. Tags had never been documented as supported, and merged commit fb8680ec (#1696) later replaced legacy image-resource handling with skopeo in Charmcraft 3.1.0.

Evaluated by: mr-cal-bot

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
stealth/space-bunny-alpha — closed not a bug Tagged-name support was not restored; affected teams migrated to digests. Charmcraft 3.1.0 later replaced legacy image handling with skopeo uploads in #1696.
stealth/space-bunny-alpha — closed resolved Affected teams migrated to image digests instead of restoring tag support. Charmcraft 3 later replaced the ambiguous image handling with skopeo uploads in #1696, released in 3.1.0.
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.

Update history

No update history recorded yet.

Related work

  • Related To: canonical/charmcraft#912 (confidence 98%)

    Follow-up issue to reject tagged references with a clearer error message rather than restore support.

  • Related To: canonical/charmcraft#1696 (confidence 95%)

    Commit fb8680ec replaced legacy OCI image-resource handling with skopeo uploads.

Related issues

Issue Project State Summary Similarity
#1953 Charmcraft 3 should still accept image digests for `upload-resource` charmcraft open Maintainer-filed Charmcraft 3 bug remains open: upload-resource still rejects bare OCI digests because Docker lookup returns only image IDs; no resolving change is present.
75%