mirror of
https://github.com/argoproj/argo-cd
synced 2026-04-21 17:07:16 +00:00
Signed-off-by: Paul Larsen <pnvlarsen@gmail.com> Signed-off-by: Blake Pettersson <blake.pettersson@gmail.com> Signed-off-by: Alexandre Gaudreault <alexandre_gaudreault@intuit.com> Co-authored-by: Blake Pettersson <blake.pettersson@gmail.com> Co-authored-by: Alexandre Gaudreault <alexandre_gaudreault@intuit.com>
33 lines
500 B
Go
33 lines
500 B
Go
package helm
|
|
|
|
import (
|
|
"fmt"
|
|
"time"
|
|
)
|
|
|
|
type Entry struct {
|
|
Version string
|
|
Created time.Time
|
|
}
|
|
|
|
type Entries []Entry
|
|
|
|
func (es Entries) Tags() []string {
|
|
tags := make([]string, len(es))
|
|
for i, e := range es {
|
|
tags[i] = e.Version
|
|
}
|
|
return tags
|
|
}
|
|
|
|
type Index struct {
|
|
Entries map[string]Entries
|
|
}
|
|
|
|
func (i *Index) GetEntries(chart string) (Entries, error) {
|
|
entries, ok := i.Entries[chart]
|
|
if !ok {
|
|
return nil, fmt.Errorf("chart '%s' not found in index", chart)
|
|
}
|
|
return entries, nil
|
|
}
|