mirror of
https://github.com/cozystack/cozystack.git
synced 2026-11-03 18:47:04 +09:00
The wrapper chart named the kernel-module ConfigMap from its own kernelModuleConfig.name key, while the NVIDIA driver mounts the ConfigMap referenced by gpu-operator.driver.kernelModuleConfig.name. The two keys defaulted to the same value but were never linked, so overriding only the driver reference left the driver pointing at a ConfigMap that is never rendered and the NVreg_NvLinkDisable=1 parameters were silently dropped. Derive the ConfigMap name from the driver's effective reference, falling back to the wrapper key when unset, so the rendered ConfigMap and the driver reference can no longer diverge. Add helm-unittest coverage for the rendered name, namespace, data key, and the create=false no-op. Assisted-By: Claude <noreply@anthropic.com> Signed-off-by: Aleksei Sviridkin <f@lex.la>
49 lines
1.2 KiB
YAML
49 lines
1.2 KiB
YAML
suite: GPU operator kernel module ConfigMap tests
|
|
|
|
templates:
|
|
- templates/kernel-module-config.yaml
|
|
|
|
tests:
|
|
- it: does not render the ConfigMap when create is false (default)
|
|
asserts:
|
|
- hasDocuments:
|
|
count: 0
|
|
|
|
- it: renders the ConfigMap into the release namespace with the nvidia.conf key when create is true
|
|
release:
|
|
name: gpu-operator
|
|
namespace: cozy-gpu-operator
|
|
set:
|
|
kernelModuleConfig:
|
|
create: true
|
|
asserts:
|
|
- hasDocuments:
|
|
count: 1
|
|
- isKind:
|
|
of: ConfigMap
|
|
- equal:
|
|
path: metadata.name
|
|
value: nvidia-kernel-module-params
|
|
- equal:
|
|
path: metadata.namespace
|
|
value: cozy-gpu-operator
|
|
- matchRegex:
|
|
path: data["nvidia.conf"]
|
|
pattern: NVreg_NvLinkDisable=1
|
|
|
|
- it: names the ConfigMap after the driver kernelModuleConfig reference so the two cannot diverge
|
|
release:
|
|
name: gpu-operator
|
|
namespace: cozy-gpu-operator
|
|
set:
|
|
kernelModuleConfig:
|
|
create: true
|
|
gpu-operator:
|
|
driver:
|
|
kernelModuleConfig:
|
|
name: my-custom-kmc
|
|
asserts:
|
|
- equal:
|
|
path: metadata.name
|
|
value: my-custom-kmc
|