From 2c1fd98b70489266b8a176ff44e9fecd8a910d2c Mon Sep 17 00:00:00 2001 From: David Barbion Date: Thu, 12 Dec 2024 15:23:46 +0100 Subject: [PATCH] chore: temporary dirs are created under PWD Git can be configured per directory using the includeIf statement in ~/.gitconfig. This allows per-customer (if you have many clients for whom you work) ssh key. Up to now, kustomize builds its yaml in /tmp/kustomize- prefixed directory. Per say, no .gitconfig on that directory. This patch instructs kustomize to use $PWD/kustomize- prefixed directory. --- kyaml/filesys/confirmeddir.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/kyaml/filesys/confirmeddir.go b/kyaml/filesys/confirmeddir.go index ea6eff90ba..d4893d6589 100644 --- a/kyaml/filesys/confirmeddir.go +++ b/kyaml/filesys/confirmeddir.go @@ -17,7 +17,8 @@ type ConfirmedDir string // The directory is cleaned, no symlinks, etc. so it's // returned as a ConfirmedDir. func NewTmpConfirmedDir() (ConfirmedDir, error) { - n, err := os.MkdirTemp("", "kustomize-") + currentDir, err := os.Getwd() + n, err := os.MkdirTemp(currentDir, ".kustomize-") if err != nil { return "", err }