Fix: index out of range when merging two repo indexes (#5146)

This commit is contained in:
andrew_li
2022-08-24 14:08:35 +08:00
committed by GitHub
parent 6029034da7
commit d3cf418c6e
2 changed files with 101 additions and 1 deletions

View File

@@ -99,6 +99,9 @@ func MergeRepoIndex(repo *v1alpha1.HelmRepo, index *helmrepo.IndexFile, existsSa
allAppNames := make(map[string]struct{}, len(index.Entries))
for name, versions := range index.Entries {
if len(versions) == 0 {
continue
}
// add new applications
if application, exists := saved.Applications[name]; !exists {
application = &Application{