Fix chart's devicePlugin.config fields evaluated to objects instead of strings when empty
Since these fields are not quoted when templated, using any special value such as null, or an empty string may result in them being evaluated as objects.
This causes an error when evaluating against the CRD definition while applying the object. As there may be more fields with the same behavior, I would probably expand this PR if needed.
While I agree that these fields shouldn't be empty, not quoting those values anyway may lead to issues and misunderstandings.
Testing process
- Create a test values file with an empty value for the config name, and a special name.
devicePlugin:
config:
name: "null"
create: true
default: ""
Pre-fix:
- Observe that the
devicePlugin.configfields are not formatted correctly
nefast@sapphire $ helm template nvidia-gpu-operator . -f test.yaml | grep devicePlugin -A 10
devicePlugin:
enabled: true
repository: nvcr.io/nvidia
image: k8s-device-plugin
version: "v0.18.1"
imagePullPolicy: IfNotPresent
config:
name: null
default:
Post-fix:
- Observe that the
devicePlugin.configfields are templated properly and that it passes server validation
nefast@sapphire $ helm template nvidia-gpu-operator . -f test.yaml | grep devicePlugin -A 8
devicePlugin:
enabled: true
repository: nvcr.io/nvidia
image: k8s-device-plugin
version: "v0.18.1"
imagePullPolicy: IfNotPresent
config:
name: "null"
default: ""
Closes #1993
This pull request requires additional validation before any workflows can run on NVIDIA's runners.
Pull request vetters can view their responsibilities here.
Contributors can view more details about this message here.
/ok-to-test https://github.com/NVIDIA/gpu-operator/commit/a77ff2b891e82999e2e68b94e1cb797568dece4f
@NoOverflow Thanks for working on this! Could you add a section in the PR description to describe how this was tested?
Hi @rajathagasthya, no problem, sorry for the oversight.
@rajathagasthya Updated. Let me know if that's fine :smile: