Loading
(K8s 4/4) Keep suspended Kubernetes environments within cleanup reach
What does this MR do?
Refuses to suspend when the cleanup could never remove the environment: the feature flag is set only as a CI/CD variable, or the job runs in an overwritten namespace. With namespace_per_job, the sweep also deletes the runner's empty labelled namespaces, and a failed resume no longer deletes its namespace and PVC. Leftover overlay ConfigMaps are removed too, selected by both PVC and runner ID.
Why was this MR needed?
Without these, some suspended environments would never be cleaned up.
What's the best way to test this MR?
go test -race ./executors/kubernetes/... -run 'Sweep|Suspend|Resume'
What are the relevant issue numbers?
Related to #39469.