This changes the naming of the aspects feature to be "registry" instead
of bundle (i.e., a configuration space backed with its own storage) and
"view" instead of aspect. Once this lands, anyone that has this enabled
needs to unset the experimental flag and rename the state entry before
refreshing snapd and then re-enable.
Signed-off-by: Miguel Pires <miguel.pires@canonical.com>
* daemon: support sideloading of components
* o/snapstate: check info in snap and component is coherent
Make sure that when we install a component it has been defined by the
owner snap and that the type is coherent betwee snap and component
metadata.
* cmd/snap: allow installation of local components
* tests/main: add spread test for components
* daemon: add component name to API data
* fixup! o/snapstate: check info in snap and component is coherent
* fixup! cmd/snap: allow installation of local components
* fixup! daemon: support sideloading of components
* fixup! tests/main: add spread test for components
* daemon: add helper for ErrorKindSnapNotInstalled errors
* fixup! daemon: support sideloading of components
As notices are originally from pebble, various adjustments must be made
in order for the ported API to work with snapd.
Signed-off-by: Oliver Calder <oliver.calder@canonical.com>
* store: Return categories in find results
This allows clients to show the categories as snapcraft.io does.
Fixes https://bugs.launchpad.net/snapd/+bug/1838786
* Remove unnecessary CategoryInfos type
* Only show categories when using --verbose
* Add tests for snap info printing categories
* Update cmd/snap/cmd_info.go
Co-authored-by: Miguel Pires <miguelpires94@gmail.com>
* Update cmd/snap/cmd_info.go
Co-authored-by: Miguel Pires <miguelpires94@gmail.com>
* v1 store API doesn't return categories
* Drop category information from snap info
Other snap commands don't support categories yet, this change should be part of that.
* Add /v2/categories and support /v2/find?category=foo
* Add note that section is deprecated
* Update client/packages.go
Co-authored-by: Miguel Pires <miguelpires94@gmail.com>
* Update daemon/api_categories.go
Co-authored-by: Miguel Pires <miguelpires94@gmail.com>
* Update daemon/api_categories.go
Co-authored-by: Miguel Pires <miguelpires94@gmail.com>
* Update daemon/api_categories.go
Co-authored-by: Miguel Pires <miguelpires94@gmail.com>
* Update store/store.go
Co-authored-by: Miguel Pires <miguelpires94@gmail.com>
* Update store/details_v2.go
Co-authored-by: Miguel Pires <miguelpires94@gmail.com>
* Update client/packages.go
Co-authored-by: Miguel Pires <miguelpires94@gmail.com>
* Improve test error message
* Drop copy/pasted comments that doesn't seem relevant
* Remove unused import
* Reorder CategoryInfo struct
* Fix accepted content type for store v2/snaps/categories request
* Set APILevel for v2/snaps/categories request
* Update accept string used to get data for store test
* Make /v2/categories return objects not just strings
---------
Co-authored-by: Miguel Pires <miguelpires94@gmail.com>
Exposes the longest hold placed by a gating snap and the user hold,
keyed by "gating-hold" and "user-hold", respectively.
Signed-off-by: Miguel Pires <miguel.pires@canonical.com>
Include all validation sets used to check in the validation error
instead of wrapping error with additional information.
Signed-off-by: Miguel Pires <miguel.pires@canonical.com>
Wrap the error returned by CheckInstalledSnaps with the new sets
that are not currently tracked. The previous approach required
marking those sets as "extra" in the validation set but was out
of place since this is only required for callers of "TryEnforce" to
resolve constraints that led to the validation error
Signed-off-by: Miguel Pires <miguel.pires@canonical.com>
* daemon: add an API endpoint to get changes associated with theme installs.
We don't want to expose the full set of /v2/changes/* endpoints to
snaps, so this provides read-only information about changes initiated
via the theme installation API.
* tests: test that the /v2/accessories/changes API works
* daemon: move /v2/accessories/changes endpoint to its own file
* daemon: add a TODO note about the access control on /v2/accessories/changes
The multipart stdlib writes formdata file parts (above a limit) to
/tmp and that could exceed the available space on devices using tmpfs.
The files would then be copied from /tmp to /var/lib/snapd/snaps.
This change adds a custom form reader that reads non-file parts into
memory and writes file parts directly to /var/lib/snapd/snaps.
https://bugs.launchpad.net/snapd/+bug/1950190