8 Commits

Author SHA1 Message Date
alfonsosanchezbeato
0a375dc253 many: support sideloading components (#13454)
* 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
2024-01-11 07:49:05 +00:00
Zeyad Gouda
9431b3f822 daemon: modify unit tests of TestErrToResponse to test multiple snaps
This modification is needed to test the edge case of having one snap
failing with ErrSnapNotFound and another snap being successful.
It used to return 500 error instead of the more useful 404.

For context see: https://bugs.launchpad.net/snapd/+bug/2024858

Signed-off-by: Zeyad Gouda <zeyad.gouda@canonical.com>
2023-07-18 16:29:45 +02:00
Samuele Pedroni
f88d78dc52 daemon: make access_test.go a bit more precise
check for the status code for the relevant errors in errors_test.go
2021-06-11 17:11:14 +02:00
Samuele Pedroni
b57cb74cba daemon: move errors-related tests from response_test.go to errors_test.go 2021-06-09 16:57:03 +02:00
Samuele Pedroni
716b13b5f9 daemon: simplify SyncResponse
it doesn't take Meta anymore
2021-06-03 13:49:26 +02:00
Samuele Pedroni
466f6206e0 daemon: use rspe (response error) instead of very contracted ae (api error) 2021-06-01 14:22:26 +02:00
Samuele Pedroni
997080239d daemon: make sure apiError and SyncResponse work together in case 2021-05-28 19:48:20 +02:00
Samuele Pedroni
793ce20605 daemon: introduce apiError StructuredResponse
apiError is a StructuredResponse (and also an error), the plan is to
use it everywhere instead of building the complicated respJSON for
errors directly

it can also be used as a return type for functions that are meant
exactly to build errors
2021-05-28 19:48:19 +02:00