|
|
@ -22,6 +22,7 @@ import (
|
|
|
|
"fmt"
|
|
|
|
"fmt"
|
|
|
|
"io/ioutil"
|
|
|
|
"io/ioutil"
|
|
|
|
"os"
|
|
|
|
"os"
|
|
|
|
|
|
|
|
"path"
|
|
|
|
"path/filepath"
|
|
|
|
"path/filepath"
|
|
|
|
"sort"
|
|
|
|
"sort"
|
|
|
|
"strings"
|
|
|
|
"strings"
|
|
|
@ -110,7 +111,7 @@ func (i IndexFile) Add(md *chart.Metadata, filename, baseURL, digest string) {
|
|
|
|
_, file := filepath.Split(filename)
|
|
|
|
_, file := filepath.Split(filename)
|
|
|
|
u, err = urlutil.URLJoin(baseURL, file)
|
|
|
|
u, err = urlutil.URLJoin(baseURL, file)
|
|
|
|
if err != nil {
|
|
|
|
if err != nil {
|
|
|
|
u = filepath.Join(baseURL, file)
|
|
|
|
u = path.Join(baseURL, file)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
cr := &ChartVersion{
|
|
|
|
cr := &ChartVersion{
|
|
|
@ -246,9 +247,11 @@ func IndexDirectory(dir, baseURL string) (*IndexFile, error) {
|
|
|
|
|
|
|
|
|
|
|
|
var parentDir string
|
|
|
|
var parentDir string
|
|
|
|
parentDir, fname = filepath.Split(fname)
|
|
|
|
parentDir, fname = filepath.Split(fname)
|
|
|
|
|
|
|
|
// filepath.Split appends an extra slash to the end of parentDir. We want to strip that out.
|
|
|
|
|
|
|
|
parentDir = strings.TrimSuffix(parentDir, string(os.PathSeparator))
|
|
|
|
parentURL, err := urlutil.URLJoin(baseURL, parentDir)
|
|
|
|
parentURL, err := urlutil.URLJoin(baseURL, parentDir)
|
|
|
|
if err != nil {
|
|
|
|
if err != nil {
|
|
|
|
parentURL = filepath.Join(baseURL, parentDir)
|
|
|
|
parentURL = path.Join(baseURL, parentDir)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
c, err := chartutil.Load(arch)
|
|
|
|
c, err := chartutil.Load(arch)
|
|
|
|