From 74f9fe6489b55a447a50dc3841a901dc66598f64 Mon Sep 17 00:00:00 2001 From: Danil-Grigorev Date: Sun, 10 Aug 2025 16:49:33 +0200 Subject: [PATCH] Ensure cleanup validates etcd proces state first Signed-off-by: Danil-Grigorev --- pkg/internal/testing/controlplane/etcd.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkg/internal/testing/controlplane/etcd.go b/pkg/internal/testing/controlplane/etcd.go index c30d213295..98ffe3ac5e 100644 --- a/pkg/internal/testing/controlplane/etcd.go +++ b/pkg/internal/testing/controlplane/etcd.go @@ -159,6 +159,10 @@ func (e *Etcd) setProcessState() error { // Stop stops this process gracefully, waits for its termination, and cleans up // the DataDir if necessary. func (e *Etcd) Stop() error { + if e.processState == nil { + return nil + } + if e.processState.DirNeedsCleaning { e.DataDir = "" // reset the directory if it was randomly allocated, so that we can safely restart }