diff --git a/src/container/builder_impl.rs b/src/container/builder_impl.rs index 857fb8439..7db9e4259 100644 --- a/src/container/builder_impl.rs +++ b/src/container/builder_impl.rs @@ -180,8 +180,8 @@ impl<'a> ContainerBuilderImpl<'a> { } fn cleanup_container(&self) -> Result<()> { - let linux = self.spec.linux.as_ref().context("no linux in spec")?; - let cgroups_path = utils::get_cgroup_path(&linux.cgroups_path, &self.container_id); + let linux = self.spec.linux().as_ref().context("no linux in spec")?; + let cgroups_path = utils::get_cgroup_path(linux.cgroups_path(), &self.container_id); let cmanager = cgroups::common::create_cgroup_manager(&cgroups_path, self.use_systemd)?; let mut errors = Vec::new();