juju refresh to revision is ignored w/ charmhub
Bug #1988556 reported by
Tom Haddon
This bug affects 5 people
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Canonical Juju |
Fix Released
|
High
|
Heather Lanigan |
Bug Description
I was running revison 60 of my charm and wanted to revert to revision 57, so I ran:
$ juju refresh indico --revision=57 --channel=edge
Added charm-hub charm "indico", revision 61 in channel edge, to the model
Leaving endpoints in "alpha": db, indico-peers, ingress, metrics-endpoint, redis
As you can see, I got revision 61 rather than 57. What is the correct way of downgrading a k8s charm, and could that command be updated to warn you that it wouldn't actually refresh you to revision 57, rather than just upgrading to the latest in that channel?
The juju model is on 2.9.32 and the juju client is 2.9.33-ubuntu-amd64 in case that's relevant.
Changed in juju: | |
milestone: | 2.9.35 → 2.9.36 |
Changed in juju: | |
milestone: | 2.9.36 → 2.9.37 |
Changed in juju: | |
milestone: | 2.9.37 → 2.9.38 |
Changed in juju: | |
milestone: | 2.9.38 → 2.9.39 |
Changed in juju: | |
milestone: | 2.9.39 → 2.9.40 |
Changed in juju: | |
milestone: | 2.9.40 → 2.9.41 |
Changed in juju: | |
milestone: | 2.9.41 → 2.9.42 |
Changed in juju: | |
milestone: | 2.9.42 → 2.9.43 |
Changed in juju: | |
milestone: | 2.9.43 → 2.9.44 |
Changed in juju: | |
milestone: | 2.9.44 → 2.9.45 |
Changed in juju: | |
assignee: | nobody → Heather Lanigan (hmlanigan) |
Changed in juju: | |
milestone: | 2.9.45 → 2.9.46 |
Changed in juju: | |
status: | Triaged → Fix Committed |
Changed in juju: | |
status: | Fix Committed → Fix Released |
To post a comment you must log in.
As far as I can tell, we ignore the '--revision' when doing `juju refresh`. I tried this with just a normal charm:
$ juju model-config -m controller logging- config= "<root> =INFO;# charmhub= TRACE" ubuntu- lite", revision 10: already up-to-date
$ juju refresh ubuntu-lite --revision 9 --channel latest/stable
charm "jameinel-
And in
$ juju debug-log -m controller
machine-0: 08:47:51 TRACE juju.apiserver. charms. charmhubrepo. client charmhub Refresh( charmhub. refreshOne{ uac5rPxJ9Jji4wc gKQ", RefreshBase{ Architecture: "amd64" , Name:"ubuntu", Channel:"20.04"}, PM_F6u5wITbndW3 VQKZp9tUYEkv24" , charms. charmhubrepo. client charmhub POST request POST /v2/charms/refresh HTTP/1.1
ID: "BlASLTVIpvpYo4
Revision: 10,
Channel: "latest/stable",
Base: charmhub.
instanceKey: "aNVoNhErQtBCGq
metrics: {},
fields: {"bases", "config-yaml", "download", "id", "license", "metadata-yaml", "name", "publisher", "resources", "revision", "summary", "type", "version"},
})
machine-0: 08:47:51 TRACE juju.apiserver.
Host: api.charmhub.io
Accept: application/json
Content-Type: application/json
User-Agent: Juju/2.9.34
{ instance- key": "aNVoNhErQtBCGq PM_F6u5wITbndW3 VQKZp9tUYEkv24" , uac5rPxJ9Jji4wc gKQ",
"architecture" : "amd64", tracking- channel" : "latest/stable" instance- key": "aNVoNhErQtBCGq PM_F6u5wITbndW3 VQKZp9tUYEkv24" , uac5rPxJ9Jji4wc gKQ", yaml",
"context": [
{
"
"id": "BlASLTVIpvpYo4
"revision": 10,
"base": {
"name": "ubuntu",
"channel": "20.04"
},
"
}
],
"actions": [
{
"action": "refresh",
"
"id": "BlASLTVIpvpYo4
"base": null
}
],
"fields": [
"bases",
"config-yaml",
"download",
"id",
"license",
"metadata-
"name",
"publisher",
"resources",
"revision",
"summary",
"type",
"version"
]
}
machine-0: 08:47:51 TRACE juju.apiserver. charms. charmhubrepo. client charmhub POST response HTTP/1.1 200 OK 3255C01BB6311FB 7720EB07C7 webapi_ refresh_ charm.charm_ refresh
Content-Length: 1539
Content-Type: application/json
Date: Fri, 02 Sep 2022 12:47:51 GMT
Server: gunicorn/20.0.4
Snap-Store-Version: 50
X-Request-Id: AE4645A7F3340A8
X-Vcs-Revision: 1a95ea7b
X-View-Name: snapdevicegw.
{
"architect ure": "amd64",
"channel" : "20.04",
"architect ure": "amd64",
"channel" : "18.04",
"architect ure": "amd64",
"channel" : "16.04",
"architect ure": "amd64",
"channel" : "14.04",
"config- yaml": "options: {}\n",
"hash- sha-256" : "caf33f5d5f2df1 99a80217a2746a8 ff04c3fd02af5a5 fad200887a5a9bf 16015", /api.charmhub. io/api/ v1/charms/ downl...
"error-list": [],
"results": [
{
"charm": {
"bases": [
{
"name": "ubuntu"
},
{
"name": "ubuntu"
},
{
"name": "ubuntu"
},
{
"name": "ubuntu"
}
],
"download": {
"size": 16867,
"url": "https:/