已合并
fix: resolve issues #192, #193, and #194 #189
xianxian-sauce创建于 9月1日
fix: resolve issues #192, #193, and #194 #189
已合并
xianxian-sauce创建于 9月1日
xianxian-sauce
9月1日

改动内容

  • 修复 #192:conchd 启动时自动创建 TMPDIR,避免自定义临时目录不存在导致 Template 创建失败。
  • 修复 #193:显式指定的配置文件不存在时直接返回错误;将 containerd registry reference 校验错误映射为 HTTP 400。
  • 修复 #194:template rm 删除不存在或已并发变化的 Template 时返回 HTTP 404,不再错误提示删除成功。

验证

  • 受影响包单元测试及 race test 通过。
  • go vet ./... 通过。
  • conch、conchd 构建通过。
likedislike
Pull Request已成功合入, 合并人@openeuler-ci-bot
(感谢 xianxian-sauce 的贡献)
xianxian-saucexianxian-sauce
9月1日 创建了 pull request,commit d2657911
atomgit-bot
atomgit-bot
9月1日 评论:

变更摘要

该 PR 针对 issues #192、#193、#194 进行修复。核心改动包括:conchd 启动时通过新增的 ensureProcessTempDir 自动创建 TMPDIR 目录,避免自定义临时目录不存在导致 Template 创建失败;config.LoadConfig 在显式指定的配置文件不存在时直接返回错误,不再静默回退到默认配置;internal/image/errors.go 将 containerd registry reference 校验错误(ErrInvalid、ErrObjectRequired、ErrHostnameRequired)映射为 HTTP 400(ErrInvalidArgument);containerd/template 的 Store.Delete 不再对不存在的记录静默返回成功,而是返回 conchtemplate.ErrNotFound(HTTP 404),同时移除 Delete 中 errdefs.IsNotFound 的吞错分支,使 template rm 对不存在或已并发变化的 Template 如实报错。

主要改动

  • daemon 启动时自动创建临时目录:在 internal/daemon/daemon.go 的 New 中新增 ensureProcessTempDir 调用,通过 os.MkdirAll(os.TempDir(), 0o700) 确保 TMPDIR 存在,修复 #192;新增 internal/daemon/temp_test.go 覆盖该行为。
  • 显式配置文件缺失时直接报错:internal/config/config.go 的 LoadConfig 删除 os.IsNotExist 时返回 DefaultConfig() 的分支,改为返回 "failed to read config file" 错误;internal/cli/client/client_test.go 相应改为验证 New 返回 os.ErrNotExist。
  • registry reference 校验错误映射为 HTTP 400:internal/image/errors.go 的 translateRegistryError 将 containerdreference.ErrInvalid、ErrObjectRequired、ErrHostnameRequired 包装为 ErrInvalidArgument,并以 internal/image/errors_test.go 新增用例验证分类结果。
  • template rm 对不存在模板返回 404:internal/adapters/containerd/template/store.go 的 Delete 移除记录不存在时返回 nil 的短路逻辑及 errdefs.IsNotFound 吞错判断,改为统一经 translateError 返回 conchtemplate.ErrNotFound;同步更新 store_test.go 与 internal/conchruntime/service_test.go,将第二次删除的幂等断言改为期望 ErrNotFound。
likedislike
不准确?
atomgit-bot
atomgit-bot
9月1日 评论:

代码审查

✅ 未发现问题

likedislike
不准确?
openeuler-ci-botopeneuler-ci-bot成员
9月1日 将weibaohui,yangzhao_kl,jimmieme,duguhaotian,wonleing,zmr_2020,gaodaweiky,lu-wei-army,zhaoyifan28设为审查人
openeuler-ci-botopeneuler-ci-bot成员
9月1日 添加了label:sig/sig-CloudNative
openeuler-ci-bot
openeuler-ci-bot成员
9月1日 评论:

Welcome To openEuler Community

Hey @lsxlee99 , thanks for your contribution to the community.

Bot Usage Manual

I'm the Bot here serving you. You can find the instructions on how to interact with me at Here . That means you can comment below every pull request or issue to trigger Bot Commands. You can self-configure the PR merge rules for this repository. For more details, please refer to Here.

Contact Guide

If you have any questions, please contact the SIG: sig-CloudNative ,
and any of the maintainers: @duguhaotian, @gaodaweiky, @jimmieme, @lu-wei-army, @weibaohui, @wonleing, @yangzhao_kl, @zhaoyifan28, @zmr_2020 ,
and any of the committers: @Yekelu .

likedislike
openeuler-ci-botopeneuler-ci-bot成员
9月1日 添加了label:stat/needs-squash
此处折叠了15条事件消息 查看更多
openeuler-ci-botopeneuler-ci-bot成员
9月1日 添加了label:openeuler-cla/yes
openeuler-ci-bot
openeuler-ci-bot成员
9月1日 评论:

CLA Signature Pass

lsxlee99, thanks for your pull request. All authors of the commits have signed the CLA. 👍

likedislike
zhaoyifan28成员
28 天前 评论:

/lgtm
/approve

likedislike
openeuler-ci-botopeneuler-ci-bot成员
28 天前 添加了label:approvedlgtm
openeuler-ci-bot
openeuler-ci-bot成员
28 天前 评论:

Review Code Feedback

  • The label lgtm, approved was added to this pull request. It means that zhaoyifan28 reviewed the code changes. 👋
Tips
  • If this pull request is not merged while all conditions are met, comment /check-pr to try again. 😄
likedislike
openeuler-ci-botopeneuler-ci-bot成员
28 天前 合入了pull request,合并节点 SHA:7885af63c6926dfb7116f18a989c827aa198fc36