Skip to content

Commit 2704163

Browse files
authored
Merge pull request #3272 from Danil-Grigorev/envtest-etcd-panic
🐛 Ensure cleanup validates etcd process state first
2 parents 49f37f9 + 74f9fe6 commit 2704163

File tree

1 file changed

+4
-0
lines changed
  • pkg/internal/testing/controlplane

1 file changed

+4
-0
lines changed

pkg/internal/testing/controlplane/etcd.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,10 @@ func (e *Etcd) setProcessState() error {
159159
// Stop stops this process gracefully, waits for its termination, and cleans up
160160
// the DataDir if necessary.
161161
func (e *Etcd) Stop() error {
162+
if e.processState == nil {
163+
return nil
164+
}
165+
162166
if e.processState.DirNeedsCleaning {
163167
e.DataDir = "" // reset the directory if it was randomly allocated, so that we can safely restart
164168
}

0 commit comments

Comments
 (0)