Colliding root-level version.properties can misreport the SDK version
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 新手友好度
- 72/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 活跃
- 技术栈
- java, kubernetes
- 领域
- build-system
调研方向
首先定位 Utils.loadFromProperties() 以及用于创建 version.properties 的 git-commit-id-maven-plugin 配置。重命名 operator-framework-core 资源并更新其查找逻辑,然后构建一个包含两个 framework artifact 的 shaded jar,并验证启动日志报告 operator framework 的 commit id 和 build time。
由索引模型根据 Issue 内容生成。
描述
Bug Report
What did you do?
Built an operator as a single shaded jar depending on both io.javaoperatorsdk:operator-framework-core (5.6.1) and io.javaoperatorsdk:kubernetes-webhooks-framework-core (3.0.4). Both artifacts generate a root-level version.properties via the git-commit-id-maven-plugin, so the two files collide at the same jar entry path.
What did you expect to see?
The operator startup log reports operator-framework-core's commit id and build time, which Utils.loadFromProperties() reads from version.properties.
What did you see instead? Under which circumstances?
ClassLoader.getResourceAsStream returns the first match, so Utils can silently report the webhooks framework's commit id and build time as the SDK version. This only surfaces when the jars are merged into one (or the classpath puts the webhooks jar first), which is probably why it went unnoticed: setups that keep the jars separate, such as Quarkus, usually resolve the operator-framework-core copy first.
Possible Solution
Give each artifact a uniquely named properties file:
- operator-framework-core:
operator-sdk-version.properties, updating the lookup inUtils.loadFromProperties()(its only reader) - kubernetes-webhooks-framework-core: for example
kubernetes-webhooks-framework-version.properties(nothing reads it today, so it is only a rename); I can file a companion issue there
Happy to contribute PRs (for both repos if needed).
- 主要语言
- Java
- 星标
- 944
- 派生
- 242
- 平均合并
- 2 天 1 小时
- 30 天内合并 PR
- 45
环境准备
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
operator-framework/java-operator-sdk 的其他 Issue
-
Method Reconciler#reconcile is not triggered when resource is deleted.可能已有人在做 @xstefank 于 7 天前认领。 未关闭
难度 4/5 3-5 天 新手友好度 55/100
operator-framework/java-operator-sdk#3621 · 8 条评论 · 已指派 1 人 ·
维护者通常 1 天内回复
-
难度 4/5 3-5 天 新手友好度 38/100
operator-framework/java-operator-sdk#3615 · 1 条评论 · 3 个 reaction ·
维护者通常 1 天内回复
-
难度 4/5 3-5 天 新手友好度 45/100
operator-framework/java-operator-sdk#3568 · 1 条评论 · 1 个 reaction ·
维护者通常 1 天内回复
-
难度 5/5 一周以上 新手友好度 25/100
operator-framework/java-operator-sdk#3563 ·
维护者通常 1 天内回复
-
Support for Virtual Threads可能已有人在做 @xstefank 于 47 天前认领。 未关闭
operator-framework/java-operator-sdk#3538 · 2 条评论 · 已指派 2 人 ·
维护者通常 1 天内回复
查看 operator-framework/java-operator-sdk 的全部 Issue
相似的 Issue
-
link-check link-check:manual
难度 2/5 1-3 小时 新手友好度 85/100
-
难度 1/5 1 小时以内 新手友好度 91/100
open-telemetry/opentelemetry-java#8870 ·
维护者通常 1 天内回复
-
P2 testing
难度 1/5 1 小时以内 新手友好度 90/100
维护者通常 1 天内回复
-
enhancement javascript
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
area/core kind/bug status/triage team/core-shared
难度 2/5 1-3 小时 新手友好度 82/100
维护者通常 1 天内回复