Skip to content

Commit

Permalink
Use path rel to working dir for kustomize build
Browse files Browse the repository at this point in the history
Work around for a bug in kustomize causing it to not properly
handle absolute paths on Windows.

Signed-off-by: Hidde Beydals <hello@hidde.co>
  • Loading branch information
hiddeco committed Dec 10, 2020
1 parent adc3d17 commit ee1f708
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions pkg/manifestgen/install/manifests.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,22 @@ func build(base, output string) error {
return fmt.Errorf("%s not found", kfile)
}

// TODO(hidde): work around for a bug in kustomize causing it to
// not properly handle absolute paths on Windows.
// Convert the path to a relative path to the working directory
// as a temporary fix:
// https://github.com/kubernetes-sigs/kustomize/issues/2789
if filepath.IsAbs(base) {
wd, err := os.Getwd()
if err != nil {
return err
}
base, err = filepath.Rel(wd, base)
if err != nil {
return err
}
}

opt := krusty.MakeDefaultOptions()
k := krusty.MakeKustomizer(fs, opt)
m, err := k.Run(base)
Expand Down

0 comments on commit ee1f708

Please sign in to comment.