Skip to content

Commit 7c93d60

Browse files
authored
fix: kustomize write target issue (argoproj-labs#583)
Signed-off-by: Daniel Mavis <daniel.mavis@faa.gov>
1 parent 5366cc1 commit 7c93d60

File tree

1 file changed

+0
-10
lines changed

1 file changed

+0
-10
lines changed

pkg/argocd/git.go

-10
Original file line numberDiff line numberDiff line change
@@ -294,18 +294,8 @@ var _ changeWriter = writeOverrides
294294
// writeKustomization writes any changes required for updating one or more images to a kustomization.yml
295295
func writeKustomization(app *v1alpha1.Application, wbc *WriteBackConfig, gitC git.Client) (err error, skip bool) {
296296
logCtx := log.WithContext().AddField("application", app.GetName())
297-
if oldDir, err := os.Getwd(); err != nil {
298-
return err, false
299-
} else {
300-
defer func() {
301-
_ = os.Chdir(oldDir)
302-
}()
303-
}
304297

305298
base := filepath.Join(gitC.Root(), wbc.KustomizeBase)
306-
if err := os.Chdir(base); err != nil {
307-
return err, false
308-
}
309299

310300
logCtx.Infof("updating base %s", base)
311301

0 commit comments

Comments
 (0)