fix: downgrade k8s.io libs to v0.34.1 to fix istiod startup panic - #40
Merged
Conversation
istiod 1.28.6-asm-r4 启动即崩溃:
panic: message *v1.Affinity is neither a v1 or v2 Message
根因:CVE 修复把 prometheus/prometheus 升到 v0.311.3,连带将
k8s.io/{api,apimachinery,client-go} 拉到 v0.35.3。k8s 1.35 为移除
gogo/protobuf,把生成类型的 ProtoMessage() 方法移入 opt-in 构建标签
kubernetes_protomessage_one_more_release,默认构建下 k8s 类型不再满足
legacy proto 接口;而 1.28 的 operator values proto 仍引用
k8s.io.api.core.v1 类型,istiod 初始化 sidecar injector 解析 values
时 protobuf 描述符懒加载直接 panic。上游 1.30+ 已在 istio#58632 中
解耦(故 1.30.3-asm 正常),上游 release-1.28/1.28.10 则始终钉在
k8s.io v0.34.1,未受影响。
修复:
- k8s.io 系列回退 v0.34.1,对齐上游 release-1.28(与 1.28.10 一致)
- prometheus 以 replace 钉 v0.305.3(3.5 LTS 修复线,同样修复
CVE-2026-42154/40179/42151/44903 且不强拉 k8s v0.35;不加 replace
时 MVS 因 gateway-api-inference-extension 抬到 v0.306.0=3.6.0,
落在漏洞区间 >=3.6.0 <3.11.3)
- 保留 grpc v1.82.1(GHSA-hrxh-6v49-42gf 修复版)及其余全部 CVE 升级
- 新增回归测试:解析含 k8s Affinity 字段的 values 不应 panic
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Signed-off-by: 王然 <ranwang@alauda.io>
This was referenced Jul 29, 2026
镜像扫描实测发现 v0.305.3(3.5 LTS) 方案行不通:产品语义上它同样 修复了 CVE-2026-42151/40179/44903(advisory 写明 fixed in 3.5.3 and 3.11.3),但 trivy DB 对 Go module 只收录 0.311.3 一条修复线,线性 版本比较下 v0.305.3 仍被判定 vulnerable。 改为:prometheus 升到 v0.311.3(漏洞库认可的修复版本),k8s.io 三件套 用 replace 钉回 v0.34.1——replace 不参与 MVS 传递,可压住 prometheus v0.311.3 对 k8s v0.35.3 的强拉,istiod 启动 panic 修复保持不变。 验证(verify-1.28/prom-0311-k8s-replace 分支已实测): - 回归测试 TestValuesApplyYAMLWithK8sAffinity 通过 - go test ./pkg/kube/inject/ 全量通过 - pilot-discovery/pilot-agent/istioctl/operator 编译通过 - trivy 扫描本地 pilot-discovery 二进制:prometheus CVE 全部清零, buildinfo 中 k8s.io 三件套呈现 v0.35.3 => v0.34.1 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Signed-off-by: 王然 <ranwang@alauda.io>
chinaran
added a commit
that referenced
this pull request
Jul 29, 2026
与 istio-1.28 分支同款调整(详见 PR #40):v0.305.3(3.5 LTS) 语义上 已修复 CVE-2026-42151/40179/44903,但 trivy DB 对 Go module 只收录 0.311.3 一条修复线,线性比较下 v0.305.3 仍被判 vulnerable,镜像扫描 无法清零。改为 prometheus v0.311.3 + replace 钉 k8s.io 三件套 v0.34.1 (replace 不参与 MVS 传递),istiod 启动 panic 修复保持不变。 1.28 分支同方案已完成端到端验证:流水线镜像 trivy 扫描 prometheus CVE 清零,业务集群部署后 istiod 正常、注入/xDS/数据面功能无影响。 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Signed-off-by: 王然 <ranwang@alauda.io>
chinaran
added a commit
that referenced
this pull request
Jul 29, 2026
与 istio-1.28 分支同款调整(详见 PR #40):v0.305.3(3.5 LTS) 语义上 已修复 CVE-2026-42151/40179/44903,但 trivy DB 对 Go module 只收录 0.311.3 一条修复线,线性比较下 v0.305.3 仍被判 vulnerable,镜像扫描 无法清零。改为 prometheus v0.311.3 + replace 钉 k8s.io 三件套 v0.34.1 (replace 不参与 MVS 传递),istiod 启动 panic 修复保持不变。 1.28 分支同方案已完成端到端验证:流水线镜像 trivy 扫描 prometheus CVE 清零,业务集群部署后 istiod 正常、注入/xDS/数据面功能无影响。 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Signed-off-by: 王然 <ranwang@alauda.io>
chinaran
added a commit
that referenced
this pull request
Jul 29, 2026
1.28.6-asm-r4 事故(prometheus v0.311.3 连带拉 k8s.io v0.35.3,k8s 1.35 移除生成类型默认 ProtoMessage(),istio 1.28 values proto 未解耦,istiod 启动即 panic)复盘回写到事故第一现场的本 skill: - tidy 后审查 k8s.io 等基础库连带升级面,超上游钉定必须回钉 - 1.28 系 prometheus 必须 v0.311.3 + replace 钉 k8s.io 三件套 v0.34.1 (v0.305.3 LTS 语义已修但被 trivy DB 线性区间否决,实测无法清零) - 落位版本以扫描器修复候选为准,勿基于 advisory 原文换修复分支; 偏离候选时推流水线前先本地 trivy 预扫 - go.mod 变更提交前跑 values/inject 最小运行时单测,拦截启动 panic 此前这批教训误写入 sail-operator 仓库同名 skill(该 skill 按仓库隔离, 在本仓库工作时不可见),本次迁至此处,sail-operator 侧同步修剪为 通用原则 + 交叉引用。修复参照 #40/#41/#42。 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Signed-off-by: 王然 <ranwang@alauda.io>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
问题
servicemesh-operator2 升级到 v2.2.0-rc.0 后,istio 1.28.6-asm-r4 的 istiod 启动即 CrashLoopBackOff:
根因
PR #36 修复 prometheus CVE 时把
prometheus/prometheus升到 v0.311.3,其 go.mod 连带将k8s.io/{api,apimachinery,client-go}拉到 v0.35.3:ProtoMessage()方法移入 opt-in 构建标签kubernetes_protomessage_one_more_release,默认构建下 k8s 类型不再满足 legacy proto 接口(Reset/String/ProtoMessage)operator/pkg/apis/values_types.proto仍 importk8s.io.api.core.v1类型,istiod 解析 injection values 时 protobuf 描述符懒加载直接 panic上游情况:上游 release-1.28(含 1.28.10)始终钉在 k8s.io v0.34.1,未踩坑,无对应修复可 cherry-pick;上游 1.30+ 在 istio#58632 中将 values proto 与 k8s 类型解耦(体量大、含 proto regen,不宜 backport),故同依赖版本的 1.30.3-asm 正常。
修复
operator/pkg/apis/values_k8s_compat_test.go验证
go test ./pkg/kube/inject/全量通过🤖 Generated with Claude Code