Skip to content

Commit 39740c1

Browse files
committed
🐛 internal: fix a possible temporary directory leak
a temporary directory leak was found when running the tests Signed-off-by: Li Zhijian <[email protected]>
1 parent 3c5b358 commit 39740c1

File tree

1 file changed

+7
-7
lines changed
  • pkg/internal/testing/integration/internal

1 file changed

+7
-7
lines changed

pkg/internal/testing/integration/internal/process.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,13 @@ func DoDefaulting(
8787
defaults.URL = *listenURL
8888
}
8989

90+
if path == "" {
91+
if name == "" {
92+
return DefaultedProcessInput{}, fmt.Errorf("must have at least one of name or path")
93+
}
94+
defaults.Path = BinPathFinder(name)
95+
}
96+
9097
if dir == "" {
9198
newDir, err := ioutil.TempDir("", "k8s_test_framework_")
9299
if err != nil {
@@ -96,13 +103,6 @@ func DoDefaulting(
96103
defaults.DirNeedsCleaning = true
97104
}
98105

99-
if path == "" {
100-
if name == "" {
101-
return DefaultedProcessInput{}, fmt.Errorf("must have at least one of name or path")
102-
}
103-
defaults.Path = BinPathFinder(name)
104-
}
105-
106106
if startTimeout == 0 {
107107
defaults.StartTimeout = 20 * time.Second
108108
}

0 commit comments

Comments
 (0)