CKS: validate-cks-node merges missing package names into one string on Debian/Ubuntu

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

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

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

调研方向

从 kubernetes-service 插件中的 validate-cks-node 脚本开始,定位到 Debian/Ubuntu 分支中使用字符串追加 +="$package" 来构建 MISSING_PACKAGES 的部分。将其声明为数组并追加元素,然后让消息用空格连接这些元素,并报告真实的数量。使用一个桩化的 dpkg 运行脚本逻辑,其中只有部分软件包已安装;当数量与缺失软件包的数量一致,且每个名称都是独立条目时,即完成。

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

描述

Problem

validate-cks-node (kubernetes-service plugin) checks a node for required packages before it is added to a CKS cluster. On Debian/Ubuntu it collects the missing ones with:

MISSING_PACKAGES+="$package"

On an array, this appends to the string in element 0. It does not add an element.

Effect Detail
Count always 1, however many are missing
Message names run together, e.g. cloud-guest-utilsapt-transport-httpscurl...
Exit status still 1, so the node is rejected, but the log does not say what to install

The RPM branch uses a different append and is not affected.

Reproduce

Run the script logic with dpkg stubbed so that only some packages are "installed":

1
Following packages are missing in the node template: cloud-guest-utilsapt-transport-httpscurlgnupg-agentsoftware-properties-commonpython3-json-pointerpython3-jsonschema
Expected

Each missing package is an array element: the count is correct and the names are separated by spaces.

Versions

4.22, main

主要语言
Java
星标
3.1k
派生
1.4k
平均合并
6 天 18 小时
30 天内合并 PR
11

环境准备

从这里开始

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

apache/cloudstack 的其他 Issue

查看 apache/cloudstack 的全部 Issue

相似的 Issue

更多 Java Issue

把新 issue 发到你的邮箱

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