mirror of
https://github.com/helm/helm.git
synced 2026-05-28 04:35:48 -04:00
feat: report in debug the version we select with version range arg
Signed-off-by: Benoit Tigeot <benoit.tigeot@lifen.fr>
This commit is contained in:
parent
1e145ee2b2
commit
bf78b876c7
2 changed files with 6 additions and 0 deletions
|
|
@ -223,6 +223,8 @@ func (i IndexFile) Get(name, version string) (*ChartVersion, error) {
|
|||
if constraint.Check(test) {
|
||||
if len(version) != 0 && !isVersionRange(version) {
|
||||
slog.Warn("unable to find exact version requested; falling back to closest available version", "chart", name, "requested", version, "selected", ver.Version)
|
||||
} else if len(version) != 0 && isVersionRange(version) {
|
||||
slog.Debug("selected version matching constraint", "chart", name, "constraint", version, "selected", ver.Version)
|
||||
}
|
||||
return ver, nil
|
||||
}
|
||||
|
|
|
|||
|
|
@ -726,6 +726,8 @@ func TestIsVersionRange(t *testing.T) {
|
|||
}{
|
||||
{"1.0.0", false},
|
||||
{"1.0.0+metadata", false},
|
||||
{"v1.19.2", false},
|
||||
{"v1", false},
|
||||
{"^1", true},
|
||||
{"^1.2.3", true},
|
||||
{"~1.10", true},
|
||||
|
|
@ -738,6 +740,8 @@ func TestIsVersionRange(t *testing.T) {
|
|||
{"1.*", true},
|
||||
{"1.x", true},
|
||||
{"1.X", true},
|
||||
{"v1.x", true},
|
||||
{"v1.X", true},
|
||||
{"1.0.0 - 2.0.0", true},
|
||||
{"^1.0.0 || ^2.0.0", true},
|
||||
{">=1.0.0 <2.0.0", true},
|
||||
|
|
|
|||
Loading…
Reference in a new issue