Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions pkg/manifests/kustomize/generator.go
Original file line number Diff line number Diff line change
Expand Up @@ -131,14 +131,12 @@ func NewKustomizeGenerator(fsys fs.FS, kustomizationPath string, _ client.Client
if err != nil {
return nil, err
}
// Note: we use relative paths as templates names to make it easier to copy the kustomization
// content into the ephemeral in-memory filesystem used by krusty in Generate()
name, err := filepath.Rel(kustomizationPath, file)
g.files[name] = raw
if err != nil {
// TODO: is it ok to panic here in case of error ?
panic("this cannot happen")
}
g.files[name] = raw
if filepath.Base(name) != componentConfigFilename && strings.HasSuffix(name, *options.TemplateSuffix) {
if t == nil {
t = template.New(name)
Expand Down Expand Up @@ -320,7 +318,7 @@ func makeFuncListFiles(files map[string][]byte) func(pattern string) ([]string,
if err != nil {
return nil, err
}
return slices.Select(maps.Keys(files), func(path string) bool { return g.Match(path) }), nil
return slices.Sort(slices.Select(maps.Keys(files), func(path string) bool { return g.Match(path) })), nil
}
}

Expand Down