Skip to content

Commit

Permalink
fix(cli): fixes incorrect writing of bundle files (#106)
Browse files Browse the repository at this point in the history
  • Loading branch information
jmgilman authored Dec 6, 2024
1 parent a483245 commit bdb2e15
Showing 1 changed file with 2 additions and 15 deletions.
17 changes: 2 additions & 15 deletions cli/pkg/deployment/gitops.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit bdb2e15

Please sign in to comment.