Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

upgrade charm.v3 to support devices #808

Merged
merged 3 commits into from
Jun 28, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
audit.log
version/init.go
/charmstore-*.tar.xz

.vscode
4 changes: 2 additions & 2 deletions dependencies.tsv
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ gopkg.in/check.v1 git 4f90aeace3a26ad7021961c297b22c42160c7b25 2016-01-05T16:49:
gopkg.in/errgo.v1 git 442357a80af5c6bf9b6d51ae791a39c3421004f3 2016-12-22T12:58:16Z
gopkg.in/goose.v2 git 4dc44b23a313a8a3e4051e7ee568a954a8cb3385 2018-02-08T12:05:40Z
gopkg.in/httprequest.v1 git 3531529dedf047a744dd77f5262515aefff8cd48 2018-03-19T12:54:57Z
gopkg.in/juju/charm.v6 git d019eb633b8e040e414a8a5df3bba0a5f76e9757 2018-06-20T04:49:47Z
gopkg.in/juju/charm.v6 git 4c7183c1a6386a8865fa6c7ddbd3de70d05f1f82 2018-06-28T05:32:07Z
gopkg.in/juju/charmrepo.v3 git 1068bda266ca4f268822587b820bf1b4a5438745 2018-06-19T10:58:31Z
gopkg.in/juju/jujusvg.v3 git 6f7342099e20c84f560bd9fc8afe96ff7486613e 2017-11-14T17:07:01Z
gopkg.in/juju/jujusvg.v3 git b69768dfdf884defd0eaf7b7f3c4e04372922d05 2018-06-28T07:42:25Z
gopkg.in/juju/names.v2 git 54f00845ae470a362430a966fe17f35f8784ac92 2017-11-13T11:20:47Z
gopkg.in/juju/worker.v1 git 6965b9d826717287bb002e02d1fd4d079978083e 2017-03-08T00:24:58Z
gopkg.in/macaroon-bakery.v2-unstable git 5a131df02b2333d5d75c501743cbc2948ee9bbf0 2016-06-23T14:27:47Z
Expand Down
7 changes: 6 additions & 1 deletion internal/charmstore/addentity.go
Original file line number Diff line number Diff line change
Expand Up @@ -677,7 +677,7 @@ func (s *Store) newBundle(id *router.ResolvedURL, r io.ReadSeeker, blobSize int6
if err != nil {
return nil, errgo.Notef(err, "cannot retrieve bundle charms")
}
if err := bundleData.VerifyWithCharms(verifyConstraints, verifyStorage, charms); err != nil {
if err := bundleData.VerifyWithCharms(verifyConstraints, verifyStorage, verifyDevices, charms); err != nil {
// TODO frankban: use multiError (defined in internal/router).
return nil, errgo.NoteMask(verificationError(err), "bundle verification failed", errgo.Is(params.ErrInvalidEntity))
}
Expand Down Expand Up @@ -836,6 +836,11 @@ func verifyStorage(s string) error {
return nil
}

func verifyDevices(s string) error {
// TODO(ycliuhw) provide some actual devices checking here.
return nil
}

// verificationError returns an error whose string representation is a list of
// all the verification error messages stored in err, in JSON format.
// Note that err must be a *charm.VerificationError.
Expand Down
2 changes: 1 addition & 1 deletion internal/charmstore/store_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -875,7 +875,7 @@ func (s *StoreSuite) TestBundleMachineCount(c *gc.C) {
url := router.MustNewResolvedURL("cs:~charmers/bundle/testbundle-0", -1)
url.URL.Revision = i
url.PromulgatedRevision = i
err := test.data.Verify(nil, nil)
err := test.data.Verify(nil, nil, nil)
c.Assert(err, gc.Equals, nil)
// Add the bundle used for this test.
b := storetesting.NewBundle(test.data)
Expand Down