new series in edge channel of k8s charm not visible

Bug #1996590 reported by Tom Haddon
30
This bug affects 6 people
Affects Status Importance Assigned to Milestone
Canonical Juju
Triaged
Medium
Unassigned

Bug Description

We're recently updated the nginx-ingress-integrator charm to "run on" 22.04 (previously it was using 20.04). This charm has been published to the edge channel of this charm.

My expectation would be that the series used to run a charm would be transparent to the user - they would simply issue a `juju refresh` command and get whatever the latest published version of the charm in the series they're tracking is. This a k8s charm where you can only have one series at a time.

However, it seems you need to specify the series to get the relevant revision of the charm.
```
mthaddon@finistere:~$ juju info nginx-ingress-integrator
name: nginx-ingress-integrator
publisher: Tom Haddon
summary: |
  An operator to configure a kubernetes ingress.
description: |
  An operator to configure a kubernetes ingress.
store-url: https://charmhub.io/nginx-ingress-integrator
charm-id: aQVXlrbsLWBTiAiQF0lilvUFolDOpKaE
supports: focal
subordinate: false
relations:
  provides:
    ingress: ingress
  requires: {}
channels: |
  latest/stable: 40 2022-11-10 (40) 8MB
  latest/candidate: ↑
  latest/beta: ↑
  latest/edge: 42 2022-11-14 (42) 12MB

mthaddon@finistere:~$ juju info nginx-ingress-integrator --series focal
name: nginx-ingress-integrator
publisher: Tom Haddon
summary: |
  An operator to configure a kubernetes ingress.
description: |
  An operator to configure a kubernetes ingress.
store-url: https://charmhub.io/nginx-ingress-integrator
charm-id: aQVXlrbsLWBTiAiQF0lilvUFolDOpKaE
supports: focal
subordinate: false
relations:
  provides:
    ingress: ingress
  requires: {}
channels: |
  latest/stable: 40 2022-11-10 (40) 8MB
  latest/candidate: ↑
  latest/beta: ↑
  latest/edge: 40 2022-11-10 (40) 8MB

```
Based on the above, if I do a `juju deploy nginx-ingress-integrator --channel=edge` I get revision 40. I'd expect revision 42. I can get revision 42 if I specify `juju deploy nginx-ingress-integrator --channel=edge --series jammy`.

Similarly for charm upgrades, I'd expect that you can just do `juju refresh nginx-ingress-integrator` and get the latest revision without having to be aware that the series has changed.

To me one of the big advantages (I had thought) of k8s charms was that there was only one series of your charm, and that charm authors could choose what that series would be and charm users would consume whatever the published series for a charm was. This would mean charm users don't have to deal with the complexity of series upgrades, which they do have to deal with in the machine charm world.

Tags: canonical-is
Tom Haddon (mthaddon)
tags: added: canonical-is
Revision history for this message
John A Meinel (jameinel) wrote :

We'll need to consider how to move forward with this.
K8s charms *do* have a series, and the current designs do intend to keep that.
Machine charms certainly have a model where 'juju refresh' stays within a series/base boundary.
It would be reasonable to loosen that for K8s charms, though we'll need some discussion in that space around "universal" charms (where you can deploy a charm and not care whether it is going to bare metal, or to a K8s environment).

As for the 'not finding jammy' when specifying "edge" that is a different charmhub bug. Specifically, the default base selection for charmhub only looks at bases that have been released to "stable" even when specifying "edge".
So Juju says "give me something on edge, but I don't know what base", which Charmhub replies with "possible bases are: 20.04", and then juju comes back and says "give me something on edge from base 20.04".

We have a separate bug tracking the ability for charmhub to give a different base selection based on the channel of the charm that we are requesting. (bug #1981579)

Changed in juju:
importance: Undecided → Medium
status: New → Incomplete
Revision history for this message
John A Meinel (jameinel) wrote :

So I dug a bit more, and I do see the response from Charmhub indicating that there is both a jammy and a focal base available for the edge channel:

```
$ curl -X POST -H 'Content-type: application/json' -s https://api.charmhub.io/v2/charms/refresh -d '{"context": [], "actions": [{"name": "nginx-ingress-integrator", "base": {"architecture": "amd64", "name": "NA", "channel": "NA"}, "action": "install", "channel": "edge", "instance-key": "a-test"}]}' | jq .
{
  "error-list": [],
  "results": [
    {
      "charm": null,
      "error": {
        "code": "invalid-charm-base",
        "extra": {
          "default-bases": [
            {
              "architecture": "amd64",
              "channel": "20.04",
              "name": "ubuntu"
            },
            {
              "architecture": "amd64",
              "channel": "22.04",
              "name": "ubuntu"
            }
          ]
        },
        "message": "Instance key 'a-test' invalid 'base' in 'install' for charm_id=aQVXlrbsLWBTiAiQF0lilvUFolDOpKaE name=nginx-ingress-integrator"
      },
      "id": "aQVXlrbsLWBTiAiQF0lilvUFolDOpKaE",
      "instance-key": "a-test",
      "name": "nginx-ingress-integrator",
      "released-at": null,
      "result": "error"
    }
  ]
}
```

However, Charmhub still prefers Focal to Jammy (it comes first in the order).

Revision history for this message
Tom Haddon (mthaddon) wrote :

Note that I can't even upgrade from the stable version of the charm to the edge version of the charm in this case because the `--series` option to `refresh` isn't supported:

```
juju refresh nginx-ingress-integrator --switch nginx-ingress-integrator --channel edge --series jammy
ERROR option provided but not defined: --series
```
So as a charm author it sounds like I have to upgrade the series of stable without having been able to test an upgrade.

Can this bug be reopened to allow for fixing that?

Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for juju because there has been no activity for 60 days.]

Changed in juju:
status: Incomplete → Expired
Revision history for this message
Tom Haddon (mthaddon) wrote :

Marking back to "New", this is still an issue

Changed in juju:
status: Expired → New
Changed in juju:
milestone: none → 2.9-backlog
status: New → Triaged
Changed in juju:
milestone: 2.9-backlog → none
Revision history for this message
Bartlomiej Gmerek (gmerold) wrote :

Hi,
I'd like to join the discussion, because I have a related problem:
In Charmed Magma charms we have recently updated the base from focal to jammy. Now it turns out, that we can't update/refresh our charms, because we get:

ERROR series "focal" not supported by charm, supported series are: jammy,kubernetes

Unfortunately, using `--force-series` is not an option.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.