-
Notifications
You must be signed in to change notification settings - Fork 22
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
Comments
Great catch @nsklikas ! This has bitten us as well and we were really wondering why this happened. This happened when we updated the charm's resource to a previously used resource (in order to work around a juju bug temporarily) and while the publish succeeded, silently it kept using the previous image, since, as you highlight, this was the latest resource version ( the CI run) |
It looks like this is more a EDIT: I meant to say charmhub, it won't allow to upload a resource that was already uploaded, so there will not be a new revision of it. |
fwiw, data-platform-workflows release_charm.yaml does not seem to be affected here's how it works, perhaps a similar approach would help here: https://github.com/canonical/data-platform-workflows/blob/58f047f7eebbde23770e7058d3f62f88ce7fe0dd/python/cli/data_platform_workflows_cli/craft_tools/release.py#L182 (or, if there's interest in moving the charm/snap/rock workflows in data-platform-workflows into a shared repo—again, happy to help with that) |
looking at our release history, this change appears to have happened on charmcraft/charmhub between 2023-10-28 and 2023-11-01 incrementing every release in 2023-10: 2023-11-01 release doesn't increment: |
and downloading charm rev 165 and 161 & inspecting manifest.yaml shows # ubuntu@j34-1:~$ cat 165/manifest.yaml
analysis:
attributes:
- name: language
result: python
- name: framework
result: operator
bases:
- architectures:
- amd64
channel: '22.04'
name: ubuntu
charmcraft-started-at: '2023-10-31T22:37:44.128831Z'
charmcraft-version: 2.4.1 # ubuntu@j34-1:~$ cat 161/manifest.yaml
analysis:
attributes:
- name: language
result: python
- name: framework
result: operator
bases:
- architectures:
- amd64
channel: '22.04'
name: ubuntu
charmcraft-started-at: '2023-10-28T13:59:41.367818Z'
charmcraft-version: 2.4.1 so change was probably on charmhub, not charmcraft |
…#147) Use resource revision number returned by upload-resource command when uploading a charm with resources. This replaces the previous behaviour when the action was listing resources and was using the latest available. Closes #139 Ref canonical/bundle-kubeflow#962
Bug Description
The
upload-charm
action:Perhaps this was caused by a (rogue?) 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
The text was updated successfully, but these errors were encountered: