← Back to issue list

Upload resources on charmcraft upload when specified as upstream-resource in the metadata file

View original Github issue

Metadata

Project
charmcraft
Number
#839
Type
issue
State
closed
Author
arturo-seijas
Labels
—
Created
Updated
Closed

Current evaluation

Feature request to auto-upload OCI resources during `charmcraft upload` was declined by design: maintainer refused to have Charmcraft copy Docker Hub images into Canonical's registry and cited upload inefficiency; user advised to script it using JSON output.

Resolution: closed not a bug

Reason: facundobatista closed it 2022-08-25 with an explicit maintainer decision that the behaviour is intentional: Charmcraft deliberately does not copy third-party images to the Canonical registry, and always uploading resources alongside charms would be inefficient. No code change was made; the closing comment points users to scripting via Charmcraft's programmatic (JSON) output.

Evaluated by: mr-cal-bot

No scores available.

Issue body

Resources source can be specified in the metadata.yaml as `upsteam-source` but they still need to be published by running the `charmcraft upload-resource` command. Here's a snippet of a resource with with this specified: ``` resources: nginx-prometheus-exporter-image: type: oci-image description: Prometheus exporter for nginx auto-fetch: true upstream-source: nginx/nginx-prometheus-exporter:0.10.0 ``` Under this scenario, the resource and the charm share their life-cycle, so it would make sense to be able to publish both the charm and the resource by running the `charmcraft upload`command. This would improve developer experience and could help control dangling images when the charm upload fails after a successful resource upload, a common scenario when publishing via CI. Thank you!

Evaluation history

Date Model Scores Action Summary
stealth/space-bunny-alpha — closed not a bug Feature request to auto-upload OCI resources during `charmcraft upload` was declined by design: maintainer refused to have Charmcraft copy Docker Hub images into Canonical's registry and cited upload inefficiency; user advised to script it using JSON output.
stealth/space-bunny-alpha — closed not a bug Feature request to auto-upload resources with `charmcraft upload` was declined by design: maintainer cited avoiding Docker Hub to Canonical registry copying and redundant uploads; users pointed to scripting with Craft's JSON output.
stealth/space-bunny-alpha — closed not a bug Feature request to auto-upload oci-image resources declared with upstream-source during charmcraft upload was declined by design: Charmcraft avoids copying Docker Hub images to Canonical's registry and redundant re-uploads; left to user scripting.
stealth/space-bunny-alpha — closed not a bug Feature request to auto-upload OCI resources with `charmcraft upload` when metadata.yaml declares `upstream-source` was declined: maintainer facundobatista closed it, citing deliberate design (no copying Docker Hub images into Canonical's registry, avoiding redundant resource uploads).
stealth/space-bunny-alpha — closed not a bug Automatic resource uploads were rejected by design: Charmcraft keeps OCI resources separate to avoid copying Docker Hub images to Canonical’s registry and prevent inefficient, repeated uploads.
qwen3.6-35b-a3b-mtp-q6 — — Rejected. Maintainers declined automatic resource uploads to prevent copying third-party images to Canonical's registry and avoid inefficient uploads. Developers should script the process using Charmcraft's CLI.
qwen/qwen3.6-35b-a3b — — Rejected. Maintainers declined automatic resource uploads to avoid copying third-party images to Canonical's registry, ensure developer control, and prevent inefficiency. Scripting Charmcraft's outputs is recommended instead.
qwen3.6-35b-a3b-mtp-q6 — — Rejected. Charmcraft will not auto-upload OCI resources with upstream-source during charm uploads to prevent copying third-party images and ensure efficiency. Developers can script Charmcraft's outputs to replicate the workflow.

Update history

No update history recorded yet.

Related work

  • Related To: canonical/charmcraft#840 (confidence 88%)

    Follow-up request for CLI options to publish charm+resources in one run, likewise declined with the same JSON-output/scripting advice.

  • Related To: canonical/charmcraft#350 (confidence 55%)

    Related resource upload behaviour work (upload-resource refactor in PR #391) that established the existing separate-resource-upload design the maintainer defended.

Related issues

Issue Project State Summary Similarity
#350 Can't upload oci-image resources from any registry but Docker Hub charmcraft closed Registry restriction was lifted in Charmcraft 1.1 by PR #391 (commit bf2d2c5e), allowing upload-resource to use local images or images from any registry.
75%
#253 Support for resource uploading charmcraft merged Merged resource-uploading support in canonical/charmcraft#253 via commit f23482c8 and merge commit ed071757.
73%
#1685 Multi-arch OCI image incorrectly uploaded to Charmhub registry charmcraft closed Fixed multi-architecture resource uploads in Charmcraft 2.7 by PR #1462 (commit 566103b8), ensuring complete OCI images reach Charmhub.
72%
#289 Specify the resource type when uploading one. charmcraft merged Merged in charmcraft#289 via commit 38ad8199, adding explicit file resource types for uploads ahead of OCI-image support and improving help text in two commands.
72%
#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.
72%
#1979 `charmcraft upload` should allow a user to also release the charm charmcraft open Requests single-command charm upload+release with automatic OCI resource handling. --release flag already exists; remaining gap is resource upload by image reference instead of revision number.
72%
#1313 Make it easier to release charms in CI and in general charmcraft open Single-command charm upload and release with OCI resources remains unimplemented; upload accepts only existing resource revisions, so users must upload resources first and track returned IDs.
71%