mirror of
https://github.com/fluxcd/flux2.git
synced 2025-10-28 23:14:48 +08:00
Use rel filepath in auto generated kustomization
This works around another bug on Windows platforms that would cause the kustomize-controller to choke on the kustomization.yaml generated by the bootstrap command due to the filepath being in a Windows format. By using `filepath.Rel`, the output is _just_ the filename for files relative to the bootstrap path, which is at the moment sufficient to make it work. Signed-off-by: Hidde Beydals <hello@hidde.co>
This commit is contained in:
@ -323,7 +323,11 @@ func GenerateKustomizationYaml(dirPath string) error {
|
||||
|
||||
var resources []string
|
||||
for _, file := range files {
|
||||
resources = append(resources, strings.Replace(file, abs, ".", 1))
|
||||
relP, err := filepath.Rel(abs, file)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
resources = append(resources, relP)
|
||||
}
|
||||
|
||||
kus.Resources = resources
|
||||
|
||||
Reference in New Issue
Block a user