You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
tools/cleanup missed the gang-scheduling-test namespace and had no way to
protect out-of-band / operator-owned installs, both hit during a live
cluster reset.
Namespace leak (two-sided):
- The gang-scheduling conformance check now deletes its own
gang-scheduling-test namespace once pods and the PodGroup are gone. The
namespace delete uses its own bounded deadline rather than the shared
cleanup context, so a pod stuck on a finalizer in the earlier waits
cannot starve the teardown (the leak this fixes).
- tools/cleanup lists gang-scheduling-test in a new AICR_CHECK_NAMESPACES
backstop, merged into phase 4 for interrupted runs.
Exclusions for out-of-band installs:
- New repeatable, comma-separated --exclude-ns and --exclude-crd flags.
--exclude-ns skips phase 1 Helm uninstall and phase 4 namespace deletion
+ finalizer rescue; --exclude-crd skips matching CRDs in phase 3, applied
after pattern matching so the broad nvidia.com pattern cannot pull
skyhook.nvidia.com CRDs back in.
- Warn on an asymmetric invocation (only one of the pair), since fencing
just the namespace still lets phase 3 cascade-delete the install's CRs.
Testing:
- tools/cleanup_test.sh: hermetic shell unit test (stubs kubectl/helm on
PATH, drives --dry-run) covering CSV/repeat parsing, per-phase exclusion,
the backstop, asymmetric-flag warnings, and fail-closed arg handling.
Wired into 'make test' via a new test-shell target.
- Unit test covering the gang-scheduling namespace teardown.
- Documented the flags in DEVELOPMENT.md.
Fixes#1672
Signed-off-by: Brian Lockwood <lockwobr@gmail.com>
log_warning "--exclude-ns given without --exclude-crd: Phase 3 will still delete the install's CRDs (and cascade its CRs). Add --exclude-crd for its API group(s)."
log_warning "--exclude-crd given without --exclude-ns: Phase 1/4 will still uninstall Helm releases in and delete the install's namespace. Add --exclude-ns."
189
+
fi
125
190
126
191
# Detect whether gpu-operator manages the NVIDIA kernel driver on this
127
192
# cluster (driver.enabled=true — e.g. EKS; GKE COS is host-managed and
@@ -219,11 +284,41 @@ is_aicr_namespace() {
219
284
return 1
220
285
}
221
286
287
+
# is_excluded_ns <namespace>: true when the operator fenced this namespace out
288
+
# with --exclude-ns.
289
+
is_excluded_ns() {
290
+
local target="$1" ns
291
+
((${#EXCLUDE_NS[@]}==0))&&return 1
292
+
fornsin"${EXCLUDE_NS[@]}";do
293
+
[[ "$target"=="$ns" ]] &&return 0
294
+
done
295
+
return 1
296
+
}
297
+
298
+
# is_excluded_crd <crd-name>: true when the CRD name contains any --exclude-crd
299
+
# match. Applied after pattern matching, so a broad pattern (e.g. nvidia.com)
300
+
# cannot pull an excluded group's CRDs (e.g. skyhook.nvidia.com) back in.
301
+
is_excluded_crd() {
302
+
local target="$1" pat
303
+
((${#EXCLUDE_CRD[@]}==0))&&return 1
304
+
forpatin"${EXCLUDE_CRD[@]}";do
305
+
[[ "$target"==*"$pat"* ]] &&return 0
306
+
done
307
+
return 1
308
+
}
309
+
310
+
# All namespaces cleanup owns: registry components plus check-created backstops.
0 commit comments