From 251cb8c24c0f1ecabec9c9a545f05061a19a4e5d Mon Sep 17 00:00:00 2001 From: Joshua Gilman Date: Thu, 5 Dec 2024 20:11:50 -0800 Subject: [PATCH] fix(cli): fixes incorrect writing of bundle files --- cli/pkg/deployment/gitops.go | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/cli/pkg/deployment/gitops.go b/cli/pkg/deployment/gitops.go index 15c2ab07..9aff6455 100644 --- a/cli/pkg/deployment/gitops.go +++ b/cli/pkg/deployment/gitops.go @@ -93,22 +93,9 @@ func (g *GitopsDeployer) Deploy() error { } g.logger.Info("Writing bundle to filesystem", "path", bundlePath) - exists, err = fileExists(g.fs, bundlePath) + bundleFile, err := g.fs.Create(bundlePath) if err != nil { - return fmt.Errorf("could not check if bundle exists: %w", err) - } - - var bundleFile billy.File - if exists { - bundleFile, err = g.fs.OpenFile(bundlePath, os.O_RDWR, os.ModePerm) - if err != nil { - return fmt.Errorf("could not open bundle file: %w", err) - } - } else { - bundleFile, err = g.fs.Create(bundlePath) - if err != nil { - return fmt.Errorf("could not create bundle file: %w", err) - } + return fmt.Errorf("could not create bundle file: %w", err) } _, err = bundleFile.Write(bundle)