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

[upload-charm] always uses the latest revision of the resource #139

Open
nsklikas opened this issue May 2, 2024 · 0 comments
Open

[upload-charm] always uses the latest revision of the resource #139

nsklikas opened this issue May 2, 2024 · 0 comments
Labels
Status: Triage Type: Bug Something isn't working

Comments

@nsklikas
Copy link

nsklikas commented May 2, 2024

Bug Description

The upload-charm action:

  1. pushes a resource to charmhub (https://github.com/canonical/charming-actions/blob/main/src/services/charmcraft/charmcraft.ts#L54)
  2. Pulls all the resource's revisions and uses the latest (https://github.com/canonical/charming-actions/blob/main/src/services/charmcraft/charmcraft.ts#L56)

Perhaps this was caused by a charmhub API change, but if you push a resource to charmhub that already exists, that resource does not get a new revision. This wasn't always the case.

This means that if a charm will always use the latest resource version and not the one defined in the metadata.

Instead uploadResource should run something like:
charmcraft upload-resource <charm-name> oci-image --image <sha> --format json --verbosity brief

And parse the output to get the revision, the call to list all the revisions is not needed.

To Reproduce

Downgrade the image in a charm's metadata

Environment

github?

Relevant log output

https://github.com/canonical/kratos-operator/actions/runs/8919940662/job/24497519038 (the resource uploaded with the charm is a difference version from the one defined in the metadata)

Additional context

No response

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

No branches or pull requests

1 participant