Colliding root-level version.properties can misreport the SDK version
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- 1-2 Tage
- Anfängerfreundlichkeit
- 72/100
- Issue-Typ
- Bug
- Klarheit
- Größtenteils klar
- Aktivitätsstatus
- Aktiv
- Tech-Stack
- java, kubernetes
- Bereich
- build-system
Rechercherichtung
Beginnen Sie damit, Utils.loadFromProperties() und die Konfiguration von git-commit-id-maven-plugin zu finden, die version.properties erstellt. Benennen Sie die Ressource von operator-framework-core um und aktualisieren Sie deren Suche. Erstellen Sie anschließend ein shaded jar, das beide Framework-Artefakte enthält, und überprüfen Sie, dass das Startprotokoll die Commit-ID und die Build-Zeit des Operator-Frameworks ausgibt.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
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).
- Vorherrschende Sprache
- Java
- Sterne
- 944
- Forks
- 242
- Ø Merge
- 1 T. 4 Std.
- Gemergte PRs (30 T.)
- 43
Beitragsleitfaden
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus operator-framework/java-operator-sdk
-
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 55/100
operator-framework/java-operator-sdk#3621 · 5 Kommentare ·
-
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 48/100
operator-framework/java-operator-sdk#3617 · 1 Kommentar ·
-
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 38/100
operator-framework/java-operator-sdk#3615 · 1 Kommentar · 3 Reaktionen ·
-
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 45/100
operator-framework/java-operator-sdk#3568 · 1 Kommentar · 1 Reaktion ·
-
Schwierigkeit 5/5 Über eine Woche Anfängerfreundlichkeit 25/100
Alle Issues in operator-framework/java-operator-sdk
Ähnliche Issues
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 76/100
-
bug needs triage
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 76/100
-
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 94/100
objectionary/hone-maven-plugin#1061 ·
-
type:bug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100