Skip to content

Commit

Permalink
Adopt thiserror for libcgroups (#1872)
Browse files Browse the repository at this point in the history
* convert systemd controllers to thiserror

Signed-off-by: squili <74628488+squili@users.noreply.github.com>

* finish systemd manager except for the CgroupManager impl

Signed-off-by: squili <74628488+squili@users.noreply.github.com>

* refactor controller traits to be internal

Signed-off-by: squili <74628488+squili@users.noreply.github.com>

* convert v1 controllers to thiserror

Signed-off-by: squili <74628488+squili@users.noreply.github.com>

* convert v2 controllers to thiserror

Signed-off-by: squili <74628488+squili@users.noreply.github.com>

* make StatsProvider an internal trait

Signed-off-by: squili <74628488+squili@users.noreply.github.com>

* replace v1 stats provider anyhow with thiserror

Signed-off-by: squili <74628488+squili@users.noreply.github.com>

* remove anyhow from v2 stats providers

Signed-off-by: squili <74628488+squili@users.noreply.github.com>

* fix lints

Signed-off-by: squili <74628488+squili@users.noreply.github.com>

* get rid of doc test error

Signed-off-by: squili <74628488+squili@users.noreply.github.com>

* convert managers from anyhow to thiserror

Signed-off-by: squili <74628488+squili@users.noreply.github.com>

* fix lints

Signed-off-by: squili <74628488+squili@users.noreply.github.com>

* get rid of the rest of the references to anyhow

Signed-off-by: squili <74628488+squili@users.noreply.github.com>

* AnyManager -> AnyCgroupManager

Signed-off-by: squili <74628488+squili@users.noreply.github.com>

* fix formatting

Signed-off-by: squili <74628488+squili@users.noreply.github.com>

* fix lint in libcgroups devices

Signed-off-by: squili <74628488+squili@users.noreply.github.com>

---------

Signed-off-by: squili <74628488+squili@users.noreply.github.com>
  • Loading branch information
squili authored May 3, 2023
1 parent 04a56c8 commit ae408ad
Show file tree
Hide file tree
Showing 56 changed files with 1,899 additions and 833 deletions.
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion crates/libcgroups/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ cgroupsv2_devices = ["rbpf", "libbpf-sys", "errno", "libc"]
nix = "0.26.2"
procfs = "0.15.1"
log = "0.4"
anyhow = "1.0"
oci-spec = { version = "^0.6.0", features = ["runtime"] }
dbus = { version = "0.9.7", optional = true }
fixedbitset = "0.4.2"
Expand All @@ -32,8 +31,10 @@ rbpf = {version = "0.1.0", optional = true }
libbpf-sys = { version = "1.1.1", optional = true }
errno = { version = "0.3.1", optional = true }
libc = { version = "0.2.142", optional = true }
thiserror = "1.0.40"

[dev-dependencies]
anyhow = "1.0"
oci-spec = { version = "^0.6.0", features = ["proptests", "runtime"] }
quickcheck = "1"
mockall = { version = "0.11.4", features = [] }
Expand Down
Loading

0 comments on commit ae408ad

Please sign in to comment.