juju / charmstore-client

Client for charmstore.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

charm release could default on resources.

jrwren opened this issue · comments

It would be nice if this happened.

Often a charm only has 1 resource revision for each resource for a charm. It would be nice if charm release would use that one revision instead of requiring it to be specified.

e.g.
now:

> charm push ubuntu --resource roottar=blah.tar.bz2
...
> charm release cs:~evarlast/ubuntu-0
ERROR cannot release charm or bundle: bad request: charm published with incorrect resources: resources are missing from publish request: roottar
> charm release cs:~evarlast/ubuntu-0 --resource roottar
error: invalid value "roottar" for flag --resource: expected name-revision format
> charm release cs:~evarlast/ubuntu-0 --resource roottar-0
url: cs:~evarlast/ubuntu-0
channel: stable
warning: bugs-url and homepage are not set.  See set command.

The it would be nice future:

> charm push ubuntu --resource roottar=blah.tar.bz2
...
> charm release cs:~evarlast/ubuntu-0
using resource roottar-0 for roottar
...

Even if there are multiple revisions available, the common case by far I'm sure is to release with the latest revision. It seems reasonable to default to that. At the very least, adding a --latest-resources flag to explicitly select the latest available resource for all resources would cut down on the tedium of manually determining and listing the revision of each resource, particularly for charms with multiple resources.