Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

[shimV2] Add sandbox filtering to ShimDiag Tasks RPC and introduce DiagSandboxes RPC

未关闭
#2,695 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 2 天内回复

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
58/100
Issue 类型
功能
描述清晰度
描述清楚
活跃度
冷清
技术栈
go

调研方向

从 internal/shimdiag/shimdiag.proto 和现有的 diagTasks 实现开始。跟踪在服务锁下如何访问 s.podControllers,然后添加 issue 中描述的按 sandbox 过滤的行为和 ListSandboxes 响应。完成标准是:省略 sandbox_id 时保留所有 pod 的结果,未知 ID 返回 NotFound,并且调用方可以枚举 sandbox ID。

由索引模型根据 Issue 内容生成。

描述

Summary

The DiagTasks RPC in the ShimDiag service currently returns all tasks running in the UVM across all pods, with no way for callers to filter by sandbox/pod. This is a holdover from when the LCOW shim only supported a single pod per UVM. Now that the shims (V1 and V2) support multiple pods sharing a single UVM, diagnostic callers need a way to scope task listings to a specific sandbox.

Relevant Discussion: https://github.com/microsoft/hcsshim/pull/2685#discussion_r3111949188

// Originally this method was intended to be used in a single pod setup and therefore,
// we do not specify a TaskID in the request. Since this shim can support multiple pods,
// we will return all tasks running in the UVM, regardless of which pod they belong to.
Proposed Changes
  • Add a sandbox_id field to TasksRequest
    Update internal/shimdiag/shimdiag.proto:
message TasksRequest {
    bool execs = 1;
    // Optional. If set, only tasks belonging to the specified sandbox/pod
    // will be returned. If empty, all tasks across all pods are returned
    // (preserves current behavior for backward compatibility).
    string sandbox_id = 2;
}

Update diagTasks to look up the specific podController by sandbox_id when provided, instead of iterating over all s.podControllers. Return a NotFound error if the sandbox ID does not exist.

  • Add a new ListSandboxes RPC
    Allow callers to enumerate the sandboxes/pods currently hosted in the UVM, so they can then make targeted DiagTasks calls.
service ShimDiag {
    // ...existing rpcs...
    rpc ListSandboxes(SandboxesRequest) returns (SandboxesResponse);
}

message ListSandboxesRequest {
}

message Sandbox {
    string id = 1;
    // Optional future fields: created_at, task_count, state, etc.
}

message ListSandboxesResponse {
    repeated Sandbox sandboxes = 1;
}

Implementation would iterate s.podControllers under the existing service lock and return their IDs.

Backward Compatibility

Adding sandbox_id as an optional field is wire-compatible; existing clients that omit it continue to receive the all-pods listing.
DiagSandboxes is purely additive.

主要语言
Go
星标
698
派生
305
平均合并
2 天 5 小时
30 天内合并 PR
20

环境准备

这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

microsoft/hcsshim 的其他 Issue

查看 microsoft/hcsshim 的全部 Issue

相似的 Issue

更多 Go Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。