juju / charmstore

The charm store server.
http://gopkg.in/juju/charmstore.v5
GNU Affero General Public License v3.0
15 stars 37 forks source link

Support uploads of bundles with per charm channels #885

Closed achilleasa closed 4 years ago

achilleasa commented 4 years ago

This PR enables charm store users to upload bundles that reference charms from different channels using bundles such as the one below:

applications:
  dummy-in-edge:
    charm: cs:~juju-qa/bionic/dummy-in-edge
    channel: edge
  other-dummy-in-beta:
    charm: cs:~juju-qa/bionic/other-dummy-in-beta
    channel: beta
  wordpress:
    charm: wordpress

In the above example, the dummy-in-edge and other-dummy-in-beta charms have been uploaded to the charm store, published to the edge and beta channels (but not on stable) and made public via charm grant $charm-url everyone.

Prior to this PR, any attempts to upload the above bundle would fail with:

ERROR cannot post archive: bundle verification failed: ["application \"dummy-in-edge\" refers to non-existent charm \"cs:~juju-qa/bionic/dummy-in-edge\"","application \"other-dummy-in-beta\" refers to non-existent charm \"cs:~juju-qa/bionic/other-dummy-in-beta\""]

The changes from this PR, bring in the latest charm.v6 dependency that includes an optional, per-application channel attribute. If defined, it will be used by the charm store code when resolving charms.

NOTE: This PR includes a newer charm.v6 version than the one included in #884. It is therefore important to ensure that this PR does not get merged before #884 lands!