operator-framework / operator-framework/java-operator-sdk
Colliding root-level version.properties can misreport the SDK version
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 944
- Forks
- 242
- Avg merge
- 1d 4h
- Merged PRs (30d)
- 43
Description
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).
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating Utils.loadFromProperties() and the git-commit-id-maven-plugin configuration that creates version.properties. Rename the operator-framework-core resource and update its lookup, then build a shaded jar containing both framework artifacts and verify the startup log reports the operator framework's commit id and build time.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, kubernetes
- Domain
- build-system
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 72/100