mirror of
https://github.com/helm/helm.git
synced 2026-05-28 04:35:48 -04:00
improves handling of Helm index with broken helm chart versions #13176
Signed-off-by: ricardo.bartels@telekom.de <ricardo.bartels@telekom.de>
This commit is contained in:
parent
2feac15cc3
commit
154b477554
1 changed files with 6 additions and 3 deletions
|
|
@ -353,6 +353,10 @@ func loadIndex(data []byte, source string) (*IndexFile, error) {
|
|||
return i, err
|
||||
}
|
||||
|
||||
if i.APIVersion == "" {
|
||||
return i, ErrNoAPIVersion
|
||||
}
|
||||
|
||||
for name, cvs := range i.Entries {
|
||||
for idx := len(cvs) - 1; idx >= 0; idx-- {
|
||||
if cvs[idx] == nil {
|
||||
|
|
@ -371,11 +375,10 @@ func loadIndex(data []byte, source string) (*IndexFile, error) {
|
|||
cvs = append(cvs[:idx], cvs[idx+1:]...)
|
||||
}
|
||||
}
|
||||
// adjust slice to only contain a set of valid versions
|
||||
i.Entries[name] = cvs
|
||||
}
|
||||
i.SortEntries()
|
||||
if i.APIVersion == "" {
|
||||
return i, ErrNoAPIVersion
|
||||
}
|
||||
return i, nil
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue