Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Reject charms with unstorable data #6859
Conversation
mjs
added some commits
Jan 24, 2017
| @@ -222,80 +222,6 @@ func (s *ApplicationSuite) TestSetCharmUpdatesBindings(c *gc.C) { | ||
| }) | ||
| } | ||
| -func (s *ApplicationSuite) TestSetCharmWithWeirdlyNamedEndpoints(c *gc.C) { |
axw
Jan 24, 2017
Member
will we be changing things later to escape/unescape? if yes, skip rather than delete?
mjs
Jan 24, 2017
Contributor
I think this was the wrong place to test this anyway. The new tests in for the State charm methods seems like a better place for this.
|
$$merge$$ |
|
Status: merge request accepted. Url: http://juju-ci.vapour.ws:8080/job/github-merge-juju |
|
Build failed: Tests failed |
|
$$merge$$ |
|
looked like a spurious lxd failure |
|
Status: merge request accepted. Url: http://juju-ci.vapour.ws:8080/job/github-merge-juju |
jujubot
merged commit 715bfce
into
juju:2.1
Jan 24, 2017
1 check failed
github-check-merge-juju
Built PR, ran unit tests, and tested LXD deploy. Use !!.*!! to request another build. IE, !!build!!, !!retry!!
Details
mjs
deleted the
mjs:reject-unstorable-charm-data
branch
Jan 24, 2017
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
mjs commentedJan 24, 2017
•
Edited 1 time
-
mjs
Jan 24, 2017
Previously, charm data was accepted that generated field names which
couldn't be stored correctly in MongoDB. MongoDB doesn't check these in
some insert scenerios but will reject them in later updates and
queries.
Fixing this properly by escaping and unescaping everywhere is too
dangerous given the imminent 2.1 release, so problematic charm data
is now rejected outright. It is unlikely that current charms will contain
metadata with invalid field names.
This PR adds some utility functions to the mongo/utils package.
MongoDB document.
field names throughout.
Drive-by: apiserver/application.StoreCharmArchive was not returning the error when a the charm update to state failed.
QA
Deployed some charms and confirmed they still work. Then deployed a charm with invalid charm data to confirm that it is rejected.