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>
pull/578/head
Hidde Beydals 4 years ago
parent ee1f70841c
commit 7a5b9e2991

@ -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

Loading…
Cancel
Save