Skip to content

Commit 74f9fe6

Browse files
Ensure cleanup validates etcd proces state first
Signed-off-by: Danil-Grigorev <[email protected]>
1 parent e8c5c54 commit 74f9fe6

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)