juju deploys an amd64 charm if --arch=arm64 is specified (and no arm64 version is available in that channel)

Bug #1984108 reported by John A Meinel
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Canonical Juju
Triaged
High
Unassigned
Snap Store Server
New
Undecided
Unassigned

Bug Description

Juju should refuse to deploy a charm if the architecture isn't supported. Currently if you try to deploy an arm64 postgresql-k8s it will end up deploying the amd64 variant, and have it just break.

When juju does `juju deploy postgresql-k8s --arch=arm64` it does a Refresh like:
```
$ curl -X POST -H 'Content-type: application/json' -s https://api.charmhub.io/v2/charms/refresh -d '{"context": [], "actions": [{"name": "kubeflow-roles", "base": {"architecture": "amd64", "name": "NA", "channel": "NA"}, "action": "install", "channel": "stable", "instance-key": "a-test"}]}' | jq .
```

However, because the store treats that as 'return all the bases that you have', Charmhub then returns a bunch of bases that are amd64 only:

```
{
  "error-list": [],
  "results": [
    {
      "charm": null,
      "error": {
        "code": "revision-not-found",
        "extra": {
          "releases": [
            {
              "base": {
                "architecture": "amd64",
                "channel": "20.04",
                "name": "ubuntu"
              },
              "channel": "stable"
            },
            {
              "base": {
                "architecture": "amd64",
                "channel": "20.04",
                "name": "ubuntu"
              },
              "channel": "candidate"
            },
            {
              "base": {
                "architecture": "amd64",
                "channel": "20.04",
                "name": "ubuntu"
              },
              "channel": "beta"
            },
            {
              "base": {
                "architecture": "amd64",
                "channel": "20.04",
                "name": "ubuntu"
              },
              "channel": "edge"
            },
            {
              "base": {
                "architecture": "amd64",
                "channel": "20.04",
                "name": "ubuntu"
              },
              "channel": "1.4/stable"
            },
            {
              "base": {
                "architecture": "amd64",
                "channel": "20.04",
                "name": "ubuntu"
              },
              "channel": "1.4/candidate"
            },
            {
              "base": {
                "architecture": "amd64",
                "channel": "20.04",
                "name": "ubuntu"
              },
              "channel": "1.4/beta"
            },
            {
              "base": {
                "architecture": "amd64",
                "channel": "20.04",
                "name": "ubuntu"
              },
              "channel": "1.4/edge"
            }
          ]
        },
        "message": "No revision was found in the Store."
      },
      "id": "qOZHieOsemJO4N6DVgnaIit9N9WrzzQx",
      "instance-key": "a-test",
      "name": "kubeflow-roles",
      "released-at": null,
      "result": "error"
    }
  ]
}
```

Likely Juju needs to be filtering the response from Refresh so that it ignores bases that aren't the right architecture. (This might also be fixed in Snapstore by having them filter it)

Tags: arm64 charmhub
Ian Booth (wallyworld)
Changed in juju:
milestone: 2.9-next → none
John A Meinel (jameinel)
summary: - juju deploys an amd64 charm if --arch=arm64 is specified
+ juju deploys an amd64 charm if --arch=arm64 is specified (and no arm64
+ version is available in that channel)
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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