Version parsing not supporting semver pre-release tag for suspend/resume system
还没有人认领这个 Issue。
评估
调研方向
从 MyLabController.suspendOrResume() 开始,这里会解析 helm list 中的 chart 字段,然后检查 HelmInstallService.installChart() 中的 SemVer 验证。跟踪 chart 名称和版本的获取方式,然后确认 suspend 和 resume 会将完整的 pre-release 版本(例如 0.1.0-abc1234)传递给 Helm upgrade 命令。
由索引模型根据 Issue 内容生成。
描述
Scope
https://github.com/InseeFrLab/onyxia-api
Describe the bug
Suspend/Resume on a user service fails with IllegalArgumentException: Invalid release version ... must be a SemVer 2 string when the Helm chart version contains a hyphen (e.g. a SemVer pre-release tag).
To Reproduce
- Install a service whose chart version contains a hyphen, e.g.
0.1.0-abc1234. - Call
POST /my-lab/app/suspendor/my-lab/app/resumewith the service ID. - API returns 500 with
Invalid release version abc1234, must be a SemVer 2 string.
Root cause
MyLabController.suspendOrResume() extracts the chart version by splitting the chart field from helm list on lastIndexOf('-'):
String chart = userService.getChart(); // "chartname-1.2.3-prerelease"
int split = chart.lastIndexOf('-');
String chartName = chart.substring(0, split); // "chartname-1.2.3" ← wrong
String version = chart.substring(split + 1); // "prerelease" ← wrong
If the version itself contains a hyphen (valid SemVer 2.0 pre-release), the split grabs only the part after the last hyphen, which lacks MAJOR.MINOR.PATCH and fails the strict SemVer regex in HelmInstallService.installChart().
Expected behavior
The full SemVer version (pre-release tag included) should be passed to the Helm upgrade command. A workaround on the client side is to never use hyphens in chart versions, but the API should handle this correctly.
Suggested fix
Replace lastIndexOf('-') with a more robust parsing approach. The chart name is known from the catalog metadata or the Onyxia secret — it shouldn't need to be re-extracted from the helm list chart field. Alternatively, use indexOf('-') and validate against known chart names.
Environment
- onyxia-api v4.11.0
- Charts with versions using SemVer pre-release tags (e.g.
MAJOR.MINOR.PATCH-prerelease)
This comment was generated by pi-agent.
- 主要语言
- Java
- 星标
- 34
- 派生
- 34
- 平均合并
- 9 分钟
- 30 天内合并 PR
- 4
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
InseeFrLab/onyxia-api 的其他 Issue
-
难度 4/5 3-5 天 新手友好度 43/100
InseeFrLab/onyxia-api#689 ·
-
Security : run helm installs / upgrades / uninstalls as a service account local to the target namespace可能已有人在做 @olevitt 于 10 天前认领。 未关闭
难度 5/5 一周以上 新手友好度 35/100
InseeFrLab/onyxia-api#688 ·
-
helmwrapper issue with rootless env : try to create /.cache可能重新可做 @olevitt 于 344 天前认领,目前没有进行中的 PR。 未关闭
InseeFrLab/onyxia-api#638 · 5 条评论 · 已指派 1 人 ·
-
难度 3/5 1-2 天 新手友好度 38/100
InseeFrLab/onyxia-api#612 · 3 条评论 ·
-
难度 4/5 3-5 天 新手友好度 35/100
InseeFrLab/onyxia-api#586 · 1 条评论 ·
查看 InseeFrLab/onyxia-api 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 3 天内回复
-
A proxy that fails to start logs a RejectedExecutionException stack trace from its shutdown hook未关闭follow-up
难度 2/5 1-3 小时 新手友好度 62/100
Sanne/incus-spawn#1953 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 72/100
atlassian/data-center-helm-charts#1170 ·
维护者通常 1 天内回复
-
Bug
难度 2/5 1-3 小时 新手友好度 70/100
维护者通常 1 天内回复
-
Issue: Bug
难度 2/5 1-3 小时 新手友好度 62/100
OpenAPITools/openapi-generator#25524 ·
维护者通常 1 天内回复