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

[Bug]: dcgm-exporter no longer gets hostNetwork when a host DCGM is set through dcgmExporter.env

未关闭 适合新手
#3,091 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

@blacksoxx 已经在做这个了。

开始于 2026年10月19日。

  • #3092 来自 @blacksoxx —— 未关闭

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
64/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
go, kubernetes
领域
backend, devops

调研方向

阅读 controllers/object_controls.go 中的 TransformDCGMExporter,以及现有测试用例“transform dcgm exporter with dcgm running on the host itself(DGX BaseOS).”。检查 dcgmExporter.env 相对于 host 网络决策的应用方式,然后为报告的容器环境变量为空的情况添加一个单元测试。完成标准是该情况设置 hostNetwork 和预期的 DNS 策略,并且测试通过。

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

描述

Describe the bug

For DCGM running on the host (DGX BaseOS), TransformDCGMExporter enables hostNetwork and ClusterFirstWithHostNet when dcgm.enabled is false and DCGM_REMOTE_HOSTENGINE_INFO starts with localhost, so the exporter can reach nv-hostengine on localhost:5555.

The check reads the variable from the container (controllers/object_controls.go, the else branch after config.DCGM.IsEnabled()), but dcgmExporter.env is only applied at the end of the function. The shipped assets/state-dcgm-exporter/0800_daemonset.yaml does not set the variable, so the check always sees an empty value and the exporter stays on the pod network, where localhost:5555 is not reachable.

The order changed in 54c270cf3 ("Ensured user-supplied envvars take precedence"), first released in v25.10.0. The existing test case "transform dcgm exporter with dcgm running on the host itself(DGX BaseOS)" still passes because it puts the variable on the input DaemonSet container as well as in dcgmExporter.env.

To Reproduce

Found by reading the code and confirmed with a unit test on main (dbb11e851): TransformDCGMExporter with dcgm.enabled: false, dcgmExporter.env: [{name: DCGM_REMOTE_HOSTENGINE_INFO, value: "localhost:5555"}] and the container env empty returns a DaemonSet with the variable set but hostNetwork: false.

Expected on a cluster (not run):

  1. Install with --set dcgm.enabled=false --set dcgmExporter.env[0].name=DCGM_REMOTE_HOSTENGINE_INFO --set dcgmExporter.env[0].value=localhost:5555 on a node running nv-hostengine.
  2. The nvidia-dcgm-exporter pod runs without hostNetwork and cannot connect to the host engine.

Setting dcgmExporter.hostNetwork: true works around it.

Expected behavior

A localhost value from dcgmExporter.env enables hostNetwork as it did before v25.10.0. A fix that runs the check after the user env is applied is in #3092.

Environment (please provide the following information):

  • GPU Operator Version: main at dbb11e851; the same code is in v26.7.2, and the order changed in v25.10.0
  • OS, kernel, container runtime, Kubernetes distro: not run on a cluster; reproduced with a unit test (Go 1.27.2, macOS arm64)
主要语言
Go
星标
2.9k
派生
576
平均合并
1 天 5 小时
30 天内合并 PR
65

环境准备

从这里开始

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

NVIDIA/gpu-operator 的其他 Issue

查看 NVIDIA/gpu-operator 的全部 Issue

相似的 Issue

更多 Go Issue

把新 issue 发到你的邮箱

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