911 Commits

Author SHA1 Message Date
Philip Meulengracht
c569177bc0 many: add frontend for journal quotas 2022-06-27 11:06:02 +02:00
Miguel Pires
e5a00935b1 cmd/snap: add 'snap debug migrate-home' command
Signed-off-by: Miguel Pires <miguel.pires@canonical.com>
2022-06-21 15:49:01 +01:00
Pawel Stolowski
f52f865a16 many: print valid/invalid status on snap validate --monitor ...
* Print valid/invalid status on snap validate --monitor <...>

* Also return validation tracking result for enforce (but ignore it in the
client).

* Removed unneeded return statement.

Co-authored-by: Miguel Pires <miguelpires94@gmail.com>

* Add checks for result when using enforce mode.

Co-authored-by: Miguel Pires <miguelpires94@gmail.com>
2022-06-03 12:44:32 +02:00
Philip Meulengracht
48fb0e2b97 client/clientutil: review feedback
improve docstrings, add missing docstrings, use nil for serial when the assertion is not provided
2022-05-12 10:33:32 +02:00
Philip Meulengracht
56f17ad957 many: review feedback
move ModelAssertJSON, add additional unit test, add additional members to test models, rename and reorder parameters
2022-05-12 10:33:31 +02:00
Philip Meulengracht
49224a30dd client/clientutil: review feedback 2022-05-12 10:33:31 +02:00
Philip Meulengracht
1b232d0973 multiple: use a shared structure for ModelAssertJSON in asserts package.
review feedback
2022-05-12 10:33:31 +02:00
Philip Meulengracht
3fd3402b5a client/clientutil: initial review feedback
remove invalid comments, rewrite some, split out some of the YAML writer code to simplify the logic
2022-05-12 10:33:30 +02:00
Philip Meulengracht
275645c370 client/clientutil: remove special case handlings for JSON 2022-05-12 10:33:30 +02:00
Philip Meulengracht
3872649dc9 client/clientutil: review feedback
split out usage of serial/model assertations, add additional unit tests for serial assertions
2022-05-12 10:33:30 +02:00
Philip Meulengracht
4794eafbd8 client/clientutil: shared yaml/json formatter
for use in snapctl model and snap model commands
2022-05-12 10:33:29 +02:00
Samuele Pedroni
557fe98c05 secboot,o/devicestate: sketching new support for ensuring/removing recovery key(s) 2022-04-25 15:19:58 +02:00
Paweł Stołowski
1f6f1ee740 Fixes related to inclusive language. 2022-04-14 12:51:08 +02:00
alfonsosanchezbeato
5013b372f2 many: change "transactional" flag to a "transaction" option
* many: change transactional flag to an option

Change the --transactional flag to an option called --transaction with
two possible values, "per-snap" and "all-snaps". The former is the
default, and makes updates/installs transactional per snap, while the
latter makes the API call transactional on the specified set of snaps,
so if one fails all the action is reverted.

* tests: adapt to change from --transactional to --transaction=...

* cmd/snap: tweak a bit description of transaction option

* daemon: do some additional checks on transaction option at the API level

* many: address some minor review comments
2022-04-07 21:05:31 +02:00
Pawel Stolowski
b7dca5e7b5 many: support --ignore-running with refresh many
* Support --ignore-running with InstallMany/UpdateMany.

* Revert install-many related changes.

* Add ignore-running to multiActionData. Add tests.

* Revert uninteded change to TestInstallMany test.
2022-04-07 13:31:48 +02:00
Philip Meulengracht
868312faaa cmd/snap,client: frontend for cpu/thread quotas
* cmd/snap,client: add support for new cpu quota switches

update tests where neccessary, add new tests

* multiple: update changes for cpu quotas

required after rebasing on top of new master, including some improvements

* cmd/snap: update documentation

* snap: simplify getCGroupVersion and rename to cgroupVersion

Instead of amending the exiting error from `cgroup.Version()`
just improve the underlying error (which is frankly not very
good). The improvement for the error is done in #11558 and
this commit just simplifies the code to use the improved error.

(thanks to Alberto)

* snap: add example cpu quota string

* snap: tweak error message from parseCpuQuota()

* snap: tweak code in parseCpuQuota() to reduce duplication

* snap: tweak error in parseQuotas() for invalid percentage and add test

* snap: tweak --cpu-set error when cgroup v1 is in use

* snap: tweak error message for negative cpu set number

* snap: tweak error message for invalid thread count and add test

* snap: comment/var init tweaks

* snap: simplify format cpu constraint code (thanks to Mardy)

* cmd/snap/cmd_quota: support more than 10 CPUs

* cmd/snap/cmd_quota: simplify error handling

* snap: split TestSetQuotaCpuSetFails() test into two for easier readability

* cmd/snap/cmd_quota: do not allow a negative number of threads

* cmd/snap/cmd_quota_test: test parseQuota() happy cases

Move a few unhappy cases to this test function, as it's actually the
proper place to do these kind of checks.

* cmd/snap/cmd_quota: do not check for the cgroup version

Let the service take care of this check.

* cmd/snap/cmd_quota: fix typo in comment

* cmd/snap/cmd_quota: fix command-line parameter name

* cmd/snap/cmd_quota_test: add a test case

* snap: rename ThreadMax -> ThreadsMax, thread -> threads

* snap: add test that outputs the two `theads=` variants from `snap quotas` (thanks to Pawel for pointing this out)

* cmd/snap: review feedback

remove memory from values when constraint is not set

Co-authored-by: Michael Vogt <mvo@ubuntu.com>
Co-authored-by: Alberto Mardegan <mardy@users.sourceforge.net>
2022-03-25 17:50:00 +01:00
Michael Vogt
277eb06412 many: replace use of "sanity" with more inclusive naming
This commit replaces the use of "sanity" with more inclusive
naming.

When `sanity` is used in a more general sense either `validity`
or `quick` is used.
2022-03-14 18:22:34 +01:00
Alfonso Sánchez-Beato
32cbe91b8b client/snap_op.go: add colon to TODO comment 2022-01-28 10:41:08 +01:00
Alfonso Sánchez-Beato
d363105501 many: address review comments 2022-01-27 16:27:44 +01:00
Alfonso Sánchez-Beato
b71dff99a3 client: add transactional flag 2022-01-26 17:49:13 +01:00
Philip Meulengracht
a8e899e128 client: Update signature of EnsureQuota to take a struct
In preparation of supporting multiple quotas
2022-01-20 11:46:21 +01:00
Miguel Pires
baa1307075 client: improve err msg 2022-01-10 16:01:17 +00:00
Miguel Pires
c8dabcecd1 cmd: support installing multiple local snaps 2022-01-04 11:58:45 +00:00
Miguel Pires
cd80af2f61 client: rename func 2021-10-06 12:26:00 +01:00
Miguel Pires
d0335406d5 client: rename InternalError to InternalClientError 2021-10-05 09:55:56 +01:00