From f7a0f2c52a2732c4efce22b46588f5ebb04c9164 Mon Sep 17 00:00:00 2001 From: Daniel Mavis <90711593+dmavis@users.noreply.github.com> Date: Wed, 5 Jul 2023 20:11:03 -0500 Subject: [PATCH] fix: kustomize write target issue (#583) Signed-off-by: Daniel Mavis Signed-off-by: Jarvis Yang --- pkg/argocd/git.go | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/pkg/argocd/git.go b/pkg/argocd/git.go index 6aa4b421..8f2ffbcf 100644 --- a/pkg/argocd/git.go +++ b/pkg/argocd/git.go @@ -294,18 +294,8 @@ var _ changeWriter = writeOverrides // writeKustomization writes any changes required for updating one or more images to a kustomization.yml func writeKustomization(app *v1alpha1.Application, wbc *WriteBackConfig, gitC git.Client) (err error, skip bool) { logCtx := log.WithContext().AddField("application", app.GetName()) - if oldDir, err := os.Getwd(); err != nil { - return err, false - } else { - defer func() { - _ = os.Chdir(oldDir) - }() - } base := filepath.Join(gitC.Root(), wbc.KustomizeBase) - if err := os.Chdir(base); err != nil { - return err, false - } logCtx.Infof("updating base %s", base)