Skip to content

Commit c7da1f3

Browse files
authored
Exclude provenance files for index creation (helm#86)
Signed-off-by: Reinhard Nägele <[email protected]>
1 parent 39e47af commit c7da1f3

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

pkg/releaser/releaser.go

+4-3
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ import (
1919
"context"
2020
"fmt"
2121
"io"
22-
"io/ioutil"
2322
"math/rand"
2423
"net/http"
2524
"net/url"
@@ -136,14 +135,16 @@ func (r *Releaser) UpdateIndexFile() (bool, error) {
136135
indexFile = repo.NewIndexFile()
137136
}
138137

139-
chartPackages, err := ioutil.ReadDir(r.config.PackagePath)
138+
// We have to explicitly glob for *.tgz files only. If GPG signing is enabled,
139+
// this would also return *.tgz.prov files otherwise, which we don't want here.
140+
chartPackages, err := filepath.Glob(r.config.PackagePath + "/*.tgz")
140141
if err != nil {
141142
return false, err
142143
}
143144

144145
var update bool
145146
for _, chartPackage := range chartPackages {
146-
ch, err := loader.LoadFile(filepath.Join(r.config.PackagePath, chartPackage.Name()))
147+
ch, err := loader.LoadFile(chartPackage)
147148
if err != nil {
148149
return false, err
149150
}

0 commit comments

Comments
 (0)