diff --git a/pkg/cli/extensions_test.go b/pkg/cli/extensions_test.go index e7a42baa..161c6cc1 100644 --- a/pkg/cli/extensions_test.go +++ b/pkg/cli/extensions_test.go @@ -608,22 +608,20 @@ func runCLIWithConfig(tempDir string, config string) (string, error) { port := GetFreePort() baseURL := GetBaseURL(port) - logFile, err := ioutil.TempFile("", "zot-log*.txt") + logFile, err := ioutil.TempFile(tempDir, "zot-log*.txt") if err != nil { return "", err } defer os.Remove(logFile.Name()) // clean up - cfgfile, err := ioutil.TempFile("", "zot-test*.json") + cfgfile, err := ioutil.TempFile(tempDir, "zot-test*.json") if err != nil { return "", err } config = fmt.Sprintf(config, tempDir, port, logFile.Name()) - defer os.Remove(cfgfile.Name()) // clean up - _, err = cfgfile.Write([]byte(config)) if err != nil { return "", err