Skip to content

kbs: print the config guide when fail to parse#184

Merged
jialez0 merged 1 commit into
openanolis:mainfrom
jialez0:trustee/coco-pickup-config-parse-guide
Jun 9, 2026
Merged

kbs: print the config guide when fail to parse#184
jialez0 merged 1 commit into
openanolis:mainfrom
jialez0:trustee/coco-pickup-config-parse-guide

Conversation

@jialez0

@jialez0 jialez0 commented Jun 8, 2026

Copy link
Copy Markdown
Collaborator

背景

吸收上游 confidential-containers/trustee 的「配置解析失败时打印配置指引」改进,提升 KBS 配置出错时的可诊断性。

  • 上游 commit:confidential-containers/trustee 9f1c010c(kbs: print the config guide when fail to parse)

改动内容

  • kbs/src/config.rsKbsConfig 加载/反序列化失败时,错误信息附带指向 KBS 配置文档对应小节的链接。
  • kbs/Cargo.toml:新增 const_format = "0.2.36"

适配说明(相对上游)

  • 文档链接指向 openanolis/trusteekbs/docs/config.md(pin 到 commit 6cae09a2)。
  • hint 小节列表按本 fork 的 KBS 配置 schema 调整:去掉 coco-only 的 storage_backend,加入本 fork 的 policy_engine

兼容性

  • 不新增/修改/删除任何 API。
  • 不修改现有配置项;新增行为仅作用于「配置解析本就失败」时的错误提示。
  • 不改变默认行为;现有部署不受影响。

验证

  • cargo check -p kbs 通过。

@shankailun-aliyun

Copy link
Copy Markdown
Collaborator

@jialez0 ,您好,您的请求已接收,请耐心等待结果。

@shankailun-aliyun

Copy link
Copy Markdown
Collaborator

@jialez0 ,您好,未检测到有镜像需要构建,如需重新检测请评论 /start

@jialez0 jialez0 force-pushed the trustee/coco-pickup-config-parse-guide branch from f17ca8f to 58c0961 Compare June 8, 2026 08:17
@shankailun-aliyun

Copy link
Copy Markdown
Collaborator

@jialez0 ,您好,您的请求已接收,请耐心等待结果。

@shankailun-aliyun

Copy link
Copy Markdown
Collaborator

@jialez0 ,您好,未检测到有镜像需要构建,如需重新检测请评论 /start

Now the configuration varies when there are breaking changes upon the
code. This commit gives a better way to tell the user if the config is
wrong. It will raise an error with a link to the relevant section of the
KBS configuration documentation.

Adapted from confidential-containers/trustee 9f1c010cfe60931323abb025195a4f16b76edbe0.
The hint table is adjusted to this fork's KBS config schema: the doc link
points to openanolis/trustee's kbs/docs/config.md, the coco-only
`storage_backend` section is dropped, and the fork-specific `policy_engine`
section is added. No existing API/config/CLI is changed; the new behaviour
only affects the error message printed when config parsing already fails.

Signed-off-by: Jiale Zhang <xinjian.zjl@alibaba-inc.com>
@jialez0 jialez0 force-pushed the trustee/coco-pickup-config-parse-guide branch from 58c0961 to ee7a883 Compare June 8, 2026 09:02
@shankailun-aliyun

Copy link
Copy Markdown
Collaborator

@jialez0 ,您好,您的请求已接收,请耐心等待结果。

@shankailun-aliyun

Copy link
Copy Markdown
Collaborator

@jialez0 ,您好,未检测到有镜像需要构建,如需重新检测请评论 /start

@jialez0 jialez0 merged commit cfa811f into openanolis:main Jun 9, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants