Details
-
Type:
Bug
-
Status: New
-
Priority:
Major
-
Resolution: Unresolved
-
Affects Version/s: 3.30.1
-
Fix Version/s: None
-
Component/s: helm
-
Labels:
-
Notability:3
Description
If Nexus encounters a Helm Chart.yaml with an non-SemVer2 appVersion (e.g. `appVersion: 0.1`), it will fail to process this component for the repo's index.yaml. The following will be written to the nexus.log:
2021-05-25 13:58:17,478+0000 INFO [event-16-thread-64287] my-user-acct org.sonatype.repository.helm.internal.orient.createindex.CreateIndexFacetImpl - Rebuilding Helm index for repository my-hosted-helm-repo
2021-05-25 13:58:17,505+0000 INFO [event-16-thread-64287] my-user-acct org.sonatype.repository.helm.internal.orient.createindex.CreateIndexFacetImpl - Finished rebuilding Helm index for repository my-hosted-helm-repo
2021-05-25 13:58:17,505+0000 ERROR [event-16-thread-64287] my-user-acct com.google.common.eventbus.EventBus.nexus.async - Could not dispatch event org.sonatype.repository.helm.internal.createindex.HelmIndexInvalidationEvent@7dc363b7 to subscriber org.sonatype.repository.helm.internal.orient.createindex.CreateIndexFacetImpl$$EnhancerByGuice$$c02ad5b@7e708e8 method [public void org.sonatype.repository.helm.internal.orient.createindex.CreateIndexFacetImpl.on(org.sonatype.repository.helm.internal.createindex.HelmIndexInvalidationEvent)]
java.lang.ClassCastException: Cannot cast java.lang.Double to java.lang.String
at java.lang.Class.cast(Class.java:3369)
at org.sonatype.nexus.common.collect.AttributesMap.coerce(AttributesMap.java:91)
at org.sonatype.nexus.common.collect.AttributesMap.get(AttributesMap.java:169)
at org.sonatype.nexus.common.collect.AttributesMap.get(AttributesMap.java:178)
at org.sonatype.repository.helm.internal.orient.createindex.CreateIndexServiceImpl.parseAssetIntoChartEntry(CreateIndexServiceImpl.java:101)
at org.sonatype.repository.helm.internal.orient.createindex.CreateIndexServiceImpl.buildIndexYaml(CreateIndexServiceImpl.java:80)
...
The `0.1` is interpreted by AttributesMap as a Double, and cannot be cast as a String. Helm encourages SemVer2, but does not require it: https://helm.sh/docs/chart_best_practices/conventions/#version-numbers
Therefore, Nexus should accept these values as well.
Attachments
Issue Links
- is related to
-
NEXUS-28392 helm-hosted: the order of "version" in index.yaml should be most recent to oldest
-
- New
-