operator-framework / operator-framework/java-operator-sdk
Colliding root-level version.properties can misreport the SDK version
Nadie ha tomado este issue todavía.
- Lenguaje dominante
- Java
- Estrellas
- 944
- Forks
- 242
- Merge medio
- 1 d 4 h
- PR fusionados (30 d)
- 43
Descripción
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).
Guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Línea de trabajo
Comienza localizando Utils.loadFromProperties() y la configuración de git-commit-id-maven-plugin que crea version.properties. Cambia el nombre del recurso de operator-framework-core y actualiza su búsqueda; después, crea un shaded jar que contenga ambos artefactos del framework y verifica que el registro de inicio muestre el commit id y la hora de compilación del operator framework.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- java, kubernetes
- Área
- build-system
- Tipo de issue
- Error
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Estado de actividad
- Activo
- Claridad
- Bastante claro
- Aptitud para principiantes
- 72/100