gpu-operator icon indicating copy to clipboard operation
gpu-operator copied to clipboard

Fix chart's devicePlugin.config fields evaluated to objects instead of strings when empty

Open NoOverflow opened this issue 1 week ago • 5 comments

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.config fields 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.config fields 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

NoOverflow avatar Dec 16 '25 16:12 NoOverflow

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.

copy-pr-bot[bot] avatar Dec 16 '25 16:12 copy-pr-bot[bot]

/ok-to-test https://github.com/NVIDIA/gpu-operator/commit/a77ff2b891e82999e2e68b94e1cb797568dece4f

rajathagasthya avatar Dec 16 '25 17:12 rajathagasthya

@NoOverflow Thanks for working on this! Could you add a section in the PR description to describe how this was tested?

rajathagasthya avatar Dec 16 '25 17:12 rajathagasthya

Hi @rajathagasthya, no problem, sorry for the oversight.

NoOverflow avatar Dec 16 '25 20:12 NoOverflow

@rajathagasthya Updated. Let me know if that's fine :smile:

NoOverflow avatar Dec 16 '25 22:12 NoOverflow