Refactor the engine.Interface such that the Set() API does not return an extraneous error

Signed-off-by: Christopher Desiniotis <cdesiniotis@nvidia.com>
This commit is contained in:
Christopher Desiniotis
2023-12-01 15:59:34 -08:00
parent ffe7ed313a
commit 83ad09b179
7 changed files with 16 additions and 13 deletions

View File

@@ -27,6 +27,8 @@ import (
// Config represents the cri-o config
type Config toml.Tree
var _ engine.Interface = (*Config)(nil)
// New creates a cri-o config with the specified options
func New(opts ...Option) (engine.Interface, error) {
b := &builder{}
@@ -100,9 +102,7 @@ func (c *Config) RemoveRuntime(name string) error {
}
// Set is not supported for cri-o configs.
func (c *Config) Set(key string, value interface{}) error {
return fmt.Errorf("Set is not supported for crio configs")
}
func (c *Config) Set(key string, value interface{}) {}
// Save writes the config to the specified path
func (c Config) Save(path string) (int64, error) {