pull/32617/merge
Shivansh Goel 2 days ago committed by GitHub
commit a79ed3626d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -52,6 +52,8 @@ var (
ErrNoChartName = errors.New("no chart name found")
// ErrEmptyIndexYaml indicates that the content of index.yaml is empty.
ErrEmptyIndexYaml = errors.New("empty index.yaml file")
// ErrRepositoryMoved indicates that the repository index has moved to a new URL.
ErrRepositoryMoved = errors.New("repository moved to new URL")
)
// ChartVersions is a list of versioned chart references.
@ -87,6 +89,9 @@ type IndexFile struct {
Entries map[string]ChartVersions `json:"entries"`
PublicKeys []string `json:"publicKeys,omitempty"`
// RedirectURL specifies a new repository URL if this repository has moved.
RedirectURL string `json:"redirectURL,omitempty"`
// Annotations are additional mappings uninterpreted by Helm. They are made available for
// other applications to add information to the index file.
Annotations map[string]string `json:"annotations,omitempty"`

@ -128,6 +128,17 @@ func TestIndexFile(t *testing.T) {
assert.Equal(t, "0.1.8", cv.Version, "Expected version: 0.1.8")
}
func TestLoadIndex_RedirectURL(t *testing.T) {
yamlData := `
apiVersion: v1
redirectURL: https://new-org.github.io/charts
entries: {}
`
i, err := loadIndex([]byte(yamlData), "test")
require.NoError(t, err)
assert.Equal(t, "https://new-org.github.io/charts", i.RedirectURL)
}
func TestLoadIndex(t *testing.T) {
tests := []struct {
Name string

Loading…
Cancel
Save