本文整理匯總了Golang中github.com/docker/docker/daemon/graphdriver.Driver.Cleanup方法的典型用法代碼示例。如果您正苦於以下問題:Golang Driver.Cleanup方法的具體用法?Golang Driver.Cleanup怎麽用?Golang Driver.Cleanup使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類github.com/docker/docker/daemon/graphdriver.Driver
的用法示例。
在下文中一共展示了Driver.Cleanup方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1:
})
JustBeforeEach(func() {
parent := layercake.DockerImageID("70d8f0edf5c9008eb61c7c52c458e7e0a831649dbb238b93dde0854faae314a8")
registerImageLayer(cake, &image.Image{
ID: parent.GraphID(),
Parent: "",
})
id = layercake.ContainerID("abc")
createContainerLayer(cake, id, parent, "")
})
AfterEach(func() {
Expect(cake.Remove(id)).To(Succeed())
Expect(driver.Cleanup()).To(Succeed())
Expect(syscall.Unmount(root, 0)).To(Succeed())
Expect(os.RemoveAll(backingStoreRoot)).To(Succeed())
})
It("should allow the user to write a file that does not exceed the quota", func() {
path, err := cake.QuotaedPath(id, 10*1024*1024)
Expect(err).NotTo(HaveOccurred())
cmd := exec.Command("dd", "if=/dev/zero", fmt.Sprintf("of=%s", filepath.Join(path, "foo")), "bs=1M", "count=8")
session, err := gexec.Start(cmd, GinkgoWriter, GinkgoWriter)
Expect(err).To(Succeed())
Eventually(session).Should(gexec.Exit(0))
})