當前位置: 首頁>>代碼示例>>Golang>>正文


Golang Driver.Cleanup方法代碼示例

本文整理匯總了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))
			})
開發者ID:cloudfoundry,項目名稱:garden-shed,代碼行數:30,代碼來源:docker_linux_test.go


注:本文中的github.com/docker/docker/daemon/graphdriver.Driver.Cleanup方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。