use default resources for testing

Bug #1992113 reported by Samuel Allan
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Canonical Juju
Triaged
Wishlist
Unassigned

Bug Description

A common pattern of k8s charms is to specify container images in metadata.yaml, with a hint at the upstream source of the images like so:

```
resources:
  mysql-image:
    type: oci-image
    description: Ubuntu LTS Docker image for MySQL
    upstream-source: dataplatformoci/mysql-and-shell:latest
```

This is all fine for deploying the charm from charmhub, because charmhub should be hosting the image as resource and juju can find it. But for deploying a local charm, juju requires providing sources for all the resources on the command line:

```
juju deploy ./mysql-k8s_ubuntu-20.04-amd64.charm --resource mysql-image=dataplatformoci/mysql-and-shell:latest
```

Same goes for local charms in bundle files:

```
  mysql:
    charm: ./mysql-k8s.charm
    resources:
      mysql-image: dataplatformoci/mysql-and-shell:latest

```

For local development and testing, this is verbose (especially for charms with multiple containers) and redundant, because most of the time we're copy/pasting from the upstream-source value in metadata.yaml.

It would be nice to have some short flag to direct juju to use these default / upstream resources, so a deployment could look something like this:

```
juju deploy ./mysql-k8s.charm --default-resources
```

or

```
mysql:
  charm: ./mysql-k8s.charm
  default_resources: true
```

Note that it's not clear if `upstream-source` key in metadata.yaml resources is officially part of the spec, but it appears to be at least a defacto standard across recent k8s charms.

Changed in juju:
status: New → Triaged
importance: Undecided → Wishlist
milestone: none → 3.0.1
Changed in juju:
milestone: 3.0.1 → 3.0.2
Changed in juju:
milestone: 3.0.2 → 3.0.3
Changed in juju:
milestone: 3.0.3 → 3.0.4
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.