mirror of
https://github.com/hanzoai/deploy.git
synced 2026-10-07 08:44:50 +00:00
Signed-off-by: Paul Larsen <[email protected]> Signed-off-by: Blake Pettersson <[email protected]> Signed-off-by: Alexandre Gaudreault <[email protected]> Co-authored-by: Blake Pettersson <[email protected]> Co-authored-by: Alexandre Gaudreault <[email protected]>
34 lines
500 B
Go
34 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
|
|
}
|