-
Notifications
You must be signed in to change notification settings - Fork 435
[no-relnote] Rename Config to TopLevelConfigPath #1301
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[no-relnote] Rename Config to TopLevelConfigPath #1301
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR implements drop-in configuration file support for NVIDIA Container Toolkit, enabling containerized environments to write NVIDIA-specific runtime configurations to separate drop-in files instead of modifying main configuration files directly.
- Adds drop-in config file support for containerd and CRI-O container runtimes
- Introduces a new
engine.Configabstraction that separates source and destination configurations - Updates test cases to validate both top-level and drop-in configuration file handling
Reviewed Changes
Copilot reviewed 19 out of 19 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| pkg/config/engine/engine.go | Introduces defaultRuntimesGetter interface to narrow function dependencies |
| pkg/config/engine/config.go | New abstraction for source/destination config separation |
| pkg/config/engine/containerd/containerd.go | Implements drop-in config support with import management |
| pkg/config/engine/containerd/config_drop_in.go | New drop-in config wrapper with import path management |
| pkg/config/engine/crio/crio.go | Updates CRI-O config to use source/destination pattern |
| cmd/nvidia-ctk-installer/container/runtime/runtime.go | Adds drop-in config path validation and default values |
| Multiple test files | Updated test expectations for drop-in configuration behavior |
| // TODO: Only do this if we've actually modified the config. | ||
| if err := c.topLevelConfig.flush(); err != nil { |
Copilot
AI
Sep 19, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The TODO comment indicates that the top-level config is always flushed, even when unchanged. This could cause unnecessary file I/O operations. Consider implementing a change tracking mechanism to only flush when the config has been modified.
| opts.ExecutablePath = "" | ||
| } | ||
| if opts.DropInConfig != "" && opts.DropInConfig != runtimeSpecificDefault { | ||
| logger.Warningf("Ignorining drop-in-config=%q flag for %v", opts.DropInConfig, opts.RuntimeName) |
Copilot
AI
Sep 19, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's a typo in the warning message. 'Ignorining' should be 'Ignoring'.
| logger.Warningf("Ignorining drop-in-config=%q flag for %v", opts.DropInConfig, opts.RuntimeName) | |
| logger.Warningf("Ignoring drop-in-config=%q flag for %v", opts.DropInConfig, opts.RuntimeName) |
531c96e to
bf68dc3
Compare
bf68dc3 to
58356af
Compare
This change renames the Config struct member to TopLevelConfigPath. This aids readability and better distinguishes between the top-level config file and a drop-in config file. Signed-off-by: Carlos Eduardo Arango Gutierrez <eduardoa@nvidia.com>
58356af to
4a56d13
Compare
Since we have introduced drop-in configs renaming
Configoption to theTopLevelConfigimproves readability.