Skip to content

Commit

Permalink
Merge pull request #408 from hmlanigan/start-of-v10
Browse files Browse the repository at this point in the history
#408

Remove "cs" has a valid schema for a charm url. Part of removing charm store support from juju. Includes removal of "http" and "https" as they are resolved to a "cs".

Given this is a breaking change, update the package revision to 10.

All unit tests should pass, including the new one testing "cs" is not a valid schema.
  • Loading branch information
jujubot authored Jan 4, 2023
2 parents de526a6 + 6768af8 commit 6beed86
Show file tree
Hide file tree
Showing 37 changed files with 279 additions and 792 deletions.
2 changes: 1 addition & 1 deletion base_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (
"github.com/juju/utils/v3/arch"
gc "gopkg.in/check.v1"

"github.com/juju/charm/v9"
"github.com/juju/charm/v10"
)

type baseSuite struct {
Expand Down
12 changes: 6 additions & 6 deletions bundle_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
jc "github.com/juju/testing/checkers"
gc "gopkg.in/check.v1"

"github.com/juju/charm/v9"
"github.com/juju/charm/v10"
)

var _ = gc.Suite(&BundleSuite{})
Expand Down Expand Up @@ -59,21 +59,21 @@ func checkWordpressBundle(c *gc.C, b charm.Bundle, path string) {
mysqlCharm := readCharmDir(c, "mysql")

bd := b.Data()
c.Assert(bd.RequiredCharms(), jc.DeepEquals, []string{"cs:mysql", "cs:wordpress"})
c.Assert(bd.RequiredCharms(), jc.DeepEquals, []string{"ch:mysql", "ch:wordpress"})

charms := map[string]charm.Charm{
"cs:wordpress": wordpressCharm,
"cs:mysql": mysqlCharm,
"ch:wordpress": wordpressCharm,
"ch:mysql": mysqlCharm,
}
err := bd.VerifyWithCharms(verifyOk, nil, nil, charms)
c.Assert(err, gc.IsNil)

c.Assert(bd.Applications, jc.DeepEquals, map[string]*charm.ApplicationSpec{
"wordpress": {
Charm: "cs:wordpress",
Charm: "ch:wordpress",
},
"mysql": {
Charm: "cs:mysql",
Charm: "ch:mysql",
NumUnits: 1,
},
})
Expand Down
2 changes: 1 addition & 1 deletion bundlearchive_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
jc "github.com/juju/testing/checkers"
gc "gopkg.in/check.v1"

"github.com/juju/charm/v9"
"github.com/juju/charm/v10"
)

var _ = gc.Suite(&BundleArchiveSuite{})
Expand Down
3 changes: 0 additions & 3 deletions bundledata.go
Original file line number Diff line number Diff line change
Expand Up @@ -640,9 +640,6 @@ func (verifier *bundleDataVerifier) verifyApplications() {
verifier.addErrorf("cannot specify revision in %q, please use revision", curl.String())
}
if app.Revision != nil {
if CharmStore.Matches(curl.Schema) && curl.Revision != -1 && curl.Revision != *app.Revision {
verifier.addErrorf("application %q has 2 different revisions specified, please choose 1", name)
}
if CharmHub.Matches(curl.Schema) && app.Channel == "" {
verifier.addErrorf("application %q with a revision requires a channel for future upgrades, please use channel", name)
}
Expand Down
Loading

0 comments on commit 6beed86

Please sign in to comment.