Skip to content

Commit

Permalink
fix: temp dir creation (#24)
Browse files Browse the repository at this point in the history
* fix temp dir creation

Signed-off-by: zachaller <[email protected]>

* wrap error instead of printing

Signed-off-by: zachaller <[email protected]>

Signed-off-by: zachaller <[email protected]>
  • Loading branch information
zachaller authored and CI committed Nov 3, 2022
1 parent 37d4396 commit 190de15
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pkg/extension/context.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,10 @@ func (c *extensionContext) Process(ctx context.Context) error {
}

// download all extension files into temp directory
tempDir := os.TempDir()
tempDir, err := os.MkdirTemp("", "")
if err != nil {
return fmt.Errorf("failed to create temp dir %w", err)
}
defer func() {
if err := os.RemoveAll(tempDir); err != nil {
log.Error(err, "Failed to delete temp directory")
Expand Down

0 comments on commit 190de15

Please sign in to comment.