From 6149bda03376e17f7ca1cd1ff73698e3c4c879db Mon Sep 17 00:00:00 2001 From: gologames Date: Fri, 15 May 2026 01:06:26 +0200 Subject: [PATCH] Fix envtest process stop on Windows --- pkg/internal/testing/process/signal_other.go | 2 +- .../testing/process/signal_windows.go | 28 +++++++++++++++++++ 2 files changed, 29 insertions(+), 1 deletion(-) create mode 100644 pkg/internal/testing/process/signal_windows.go diff --git a/pkg/internal/testing/process/signal_other.go b/pkg/internal/testing/process/signal_other.go index 5cbce8f416..dad979847e 100644 --- a/pkg/internal/testing/process/signal_other.go +++ b/pkg/internal/testing/process/signal_other.go @@ -1,4 +1,4 @@ -//go:build !aix && !darwin && !dragonfly && !freebsd && !linux && !netbsd && !openbsd && !solaris && !zos +//go:build !aix && !darwin && !dragonfly && !freebsd && !linux && !netbsd && !openbsd && !solaris && !windows && !zos /* Copyright 2026 The Kubernetes Authors. diff --git a/pkg/internal/testing/process/signal_windows.go b/pkg/internal/testing/process/signal_windows.go new file mode 100644 index 0000000000..678d5924ce --- /dev/null +++ b/pkg/internal/testing/process/signal_windows.go @@ -0,0 +1,28 @@ +//go:build windows + +/* +Copyright 2026 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package process + +import ( + "os" + "syscall" +) + +func signalProcess(process *os.Process, _ syscall.Signal) error { + return process.Kill() +}