Add cdi.enabled option to runtime configure

Signed-off-by: Evan Lezar <elezar@nvidia.com>
This commit is contained in:
Evan Lezar
2023-10-31 15:24:27 +01:00
parent b8b134f389
commit 61595aa0fa
6 changed files with 50 additions and 0 deletions

View File

@@ -133,6 +133,14 @@ func (c *ConfigV1) RemoveRuntime(name string) error {
return nil
}
// SetOption sets the specified containerd option.
func (c *ConfigV1) Set(key string, value interface{}) error {
config := *c.Tree
config.SetPath([]string{"plugins", "cri", "containerd", key}, value)
*c.Tree = config
return nil
}
// Save wrotes the config to a file
func (c ConfigV1) Save(path string) (int64, error) {
return (Config)(c).Save(path)

View File

@@ -89,6 +89,14 @@ func (c *Config) getRuntimeAnnotations(path []string) ([]string, error) {
return annotations, nil
}
// Set sets the specified containerd option.
func (c *Config) Set(key string, value interface{}) error {
config := *c.Tree
config.SetPath([]string{"plugins", "io.containerd.grpc.v1.cri", key}, value)
*c.Tree = config
return nil
}
// DefaultRuntime returns the default runtime for the cri-o config
func (c Config) DefaultRuntime() string {
if runtime, ok := c.GetPath([]string{"plugins", "io.containerd.grpc.v1.cri", "containerd", "default_runtime_name"}).(string); ok {