From 190de15cbe8db9fe832a0b4cc7e5eddeb0c47989 Mon Sep 17 00:00:00 2001 From: Zach Aller Date: Thu, 3 Nov 2022 15:34:05 -0500 Subject: [PATCH] fix: temp dir creation (#24) * fix temp dir creation Signed-off-by: zachaller * wrap error instead of printing Signed-off-by: zachaller Signed-off-by: zachaller --- pkg/extension/context.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pkg/extension/context.go b/pkg/extension/context.go index 3f4045b..8ff6689 100644 --- a/pkg/extension/context.go +++ b/pkg/extension/context.go @@ -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")