Skip to content

Commit 8aa53c9

Browse files
authored
Merge branch 'main' into renovate/major-major-deps
2 parents ba9329f + 46a61e1 commit 8aa53c9

3 files changed

Lines changed: 10 additions & 6 deletions

File tree

internal/helm/chart.go

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ func ParseChart(fsys fs.FS, chartPath string, parent *Chart) (*Chart, error) {
125125
}
126126

127127
chart.files = Files{}
128-
files, err := fileutils.Find(fsys, "", "", fileutils.FileTypeRegular|fileutils.FileTypeSymlink, 0)
128+
files, err := fileutils.Find(fsys, filepath.Clean(chartPath), "", fileutils.FileTypeRegular|fileutils.FileTypeSymlink, 0)
129129
if err != nil {
130130
return nil, err
131131
}
@@ -134,7 +134,12 @@ func ParseChart(fsys fs.FS, chartPath string, parent *Chart) (*Chart, error) {
134134
if err != nil {
135135
return nil, err
136136
}
137-
chart.files.add(file, raw)
137+
name, err := filepath.Rel(chartPath, file)
138+
if err != nil {
139+
// TODO: is it ok to panic here in case of error ?
140+
panic("this cannot happen")
141+
}
142+
chart.files.add(name, raw)
138143
}
139144

140145
valuesRaw, err := fs.ReadFile(fsys, filepath.Clean(chartPath+"/values.yaml"))

internal/helm/files.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ func (f Files) AsSecrets() string {
8888

8989
func isIgnored(name string) bool {
9090
return name == "Chart.yaml" ||
91+
name == "Chart.lock" ||
9192
name == "LICENSE" ||
9293
name == "README.md" ||
9394
name == "values.yaml" ||

pkg/manifests/kustomize/generator.go

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -131,14 +131,12 @@ func NewKustomizeGenerator(fsys fs.FS, kustomizationPath string, _ client.Client
131131
if err != nil {
132132
return nil, err
133133
}
134-
// Note: we use relative paths as templates names to make it easier to copy the kustomization
135-
// content into the ephemeral in-memory filesystem used by krusty in Generate()
136134
name, err := filepath.Rel(kustomizationPath, file)
137-
g.files[name] = raw
138135
if err != nil {
139136
// TODO: is it ok to panic here in case of error ?
140137
panic("this cannot happen")
141138
}
139+
g.files[name] = raw
142140
if filepath.Base(name) != componentConfigFilename && strings.HasSuffix(name, *options.TemplateSuffix) {
143141
if t == nil {
144142
t = template.New(name)
@@ -320,7 +318,7 @@ func makeFuncListFiles(files map[string][]byte) func(pattern string) ([]string,
320318
if err != nil {
321319
return nil, err
322320
}
323-
return slices.Select(maps.Keys(files), func(path string) bool { return g.Match(path) }), nil
321+
return slices.Sort(slices.Select(maps.Keys(files), func(path string) bool { return g.Match(path) })), nil
324322
}
325323
}
326324

0 commit comments

Comments
 (0)