1 Star 0 Fork 58

gnaygnil/docker

forked from src-openEuler/docker 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0077-image-fix-file-not-exist-for-check-file-size.patch 997 Bytes
一键复制 编辑 原始数据 按行查看 历史
gnaygnil 提交于 2020-02-13 15:36 . docker: Fixed build error and URL
From be262686615a41b7377e5e19c9aae2a1d71cb4fb Mon Sep 17 00:00:00 2001
From: jingrui <jingrui@huawei.com>
Date: Tue, 22 Jan 2019 17:20:38 +0800
Subject: [PATCH 077/111] image: fix file not exist for check file
size
reason: check file size should support file not exist.
Change-Id: Iae3b8d4f477d6cfc51ba71a185a598687f8393a2
Signed-off-by: jingrui <jingrui@huawei.com>
---
components/engine/image/tarexport/load.go | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/components/engine/image/tarexport/load.go b/components/engine/image/tarexport/load.go
index b9f8f7e3ac..34574129f1 100644
--- a/components/engine/image/tarexport/load.go
+++ b/components/engine/image/tarexport/load.go
@@ -432,6 +432,10 @@ func checkValidParent(img, parent *image.Image) bool {
func checkJsonFileSize(path string) error {
fileInfo, err := os.Stat(path)
if err != nil {
+ // path can not exist.
+ if os.IsNotExist(err) {
+ return nil
+ }
return err
}
fileSize := fileInfo.Size()
--
2.17.1
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/gnaygnil/docker.git
git@gitee.com:gnaygnil/docker.git
gnaygnil
docker
docker
master

搜索帮助