Skip to content

fix: Allow config options to be set to default values#1629

Merged
elezar merged 2 commits intoNVIDIA:mainfrom
elezar:fix-debug-in-config
Feb 5, 2026
Merged

fix: Allow config options to be set to default values#1629
elezar merged 2 commits intoNVIDIA:mainfrom
elezar:fix-debug-in-config

Conversation

@elezar
Copy link
Member

@elezar elezar commented Feb 5, 2026

This change fixes a bug, where when using the nvidia-ctk config --set
command to set a config option (e.g. nvidia-container-runtime.debug) to
its default value does not change the rendered config.

Fixes ##1626

For example, before this change:

$ ./nvidia-ctk config --set accept-nvidia-visible-devices-as-volume-mounts=false | grep accept-nvidia
#accept-nvidia-visible-devices-as-volume-mounts = false
#accept-nvidia-visible-devices-envvar-when-unprivileged = true
$ ./nvidia-ctk config --set nvidia-container-runtime.debug=/var/log/nvidia-container-runtime.log | grep debug
#debug = "/var/log/nvidia-container-toolkit.log"
#debug = "/var/log/nvidia-container-runtime.log"

With this change:

$ ./nvidia-ctk config --set accept-nvidia-visible-devices-as-volume-mounts=false | grep accept-nvidia
accept-nvidia-visible-devices-as-volume-mounts = false
#accept-nvidia-visible-devices-envvar-when-unprivileged = true
$ ./nvidia-ctk config --set nvidia-container-runtime.debug=/var/log/nvidia-container-runtime.log | grep debug
#debug = "/var/log/nvidia-container-toolkit.log"
debug = "/var/log/nvidia-container-runtime.log"

Signed-off-by: Evan Lezar <elezar@nvidia.com>
@coveralls
Copy link

coveralls commented Feb 5, 2026

Pull Request Test Coverage Report for Build 21717264199

Details

  • 24 of 31 (77.42%) changed or added relevant lines in 1 file are covered.
  • 1 unchanged line in 1 file lost coverage.
  • Overall coverage increased (+0.09%) to 39.566%

Changes Missing Coverage Covered Lines Changed/Added Lines %
internal/config/toml.go 24 31 77.42%
Files with Coverage Reduction New Missed Lines %
internal/config/toml.go 1 70.37%
Totals Coverage Status
Change from base Build 21714428539: 0.09%
Covered Lines: 5724
Relevant Lines: 14467

💛 - Coveralls

@elezar elezar added this to the v1.18.3 milestone Feb 5, 2026
This change fixes a bug, where when using the nvidia-ctk config --set
command to set a config option (e.g. nvidia-container-runtime.debug) to
its default value does not change the rendered config.

Signed-off-by: Evan Lezar <elezar@nvidia.com>
@elezar
Copy link
Member Author

elezar commented Feb 5, 2026

/cherry-pick release-1.18

@elezar elezar merged commit 367cf47 into NVIDIA:main Feb 5, 2026
16 checks passed
@elezar elezar deleted the fix-debug-in-config branch February 5, 2026 18:45
@github-actions
Copy link

github-actions bot commented Feb 5, 2026

🤖 Backport PR created for release-1.18: #1630

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Issue/PR to expose/discuss/fix a bug cherry-pick/release-1.18

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants