diff --git a/internal/config/config.go b/internal/config/config.go index c281acd9..c804f2ac 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -81,12 +81,12 @@ func GetConfig() (*Config, error) { // Load loads the config from the specified file path. func Load(configFilePath string) (*Config, error) { if configFilePath == "" { - return getDefault() + return GetDefault() } tomlFile, err := os.Open(configFilePath) if err != nil { - return getDefault() + return GetDefault() } defer tomlFile.Close() @@ -114,7 +114,7 @@ func LoadFrom(reader io.Reader) (*Config, error) { // getFromTree reads the nvidia container runtime config from the specified toml Tree. func getFromTree(toml *toml.Tree) (*Config, error) { - cfg, err := getDefault() + cfg, err := GetDefault() if err != nil { return nil, err } @@ -129,8 +129,8 @@ func getFromTree(toml *toml.Tree) (*Config, error) { return cfg, nil } -// getDefault defines the default values for the config -func getDefault() (*Config, error) { +// GetDefault defines the default values for the config +func GetDefault() (*Config, error) { d := Config{ AcceptEnvvarUnprivileged: true, NVIDIAContainerCLIConfig: ContainerCLIConfig{ diff --git a/internal/config/config_test.go b/internal/config/config_test.go index 3f94bc26..41be9e40 100644 --- a/internal/config/config_test.go +++ b/internal/config/config_test.go @@ -237,7 +237,7 @@ func TestGetConfig(t *testing.T) { } func TestConfigDefault(t *testing.T) { - config, err := getDefault() + config, err := GetDefault() require.NoError(t, err) buffer := new(bytes.Buffer) diff --git a/internal/config/hook.go b/internal/config/hook.go index 99c52061..3292f138 100644 --- a/internal/config/hook.go +++ b/internal/config/hook.go @@ -27,7 +27,7 @@ type RuntimeHookConfig struct { // GetDefaultRuntimeHookConfig defines the default values for the config func GetDefaultRuntimeHookConfig() (*RuntimeHookConfig, error) { - cfg, err := getDefault() + cfg, err := GetDefault() if err != nil { return nil, err } diff --git a/internal/config/runtime.go b/internal/config/runtime.go index ba9fc83c..ed9ea646 100644 --- a/internal/config/runtime.go +++ b/internal/config/runtime.go @@ -48,7 +48,7 @@ type csvModeConfig struct { // GetDefaultRuntimeConfig defines the default values for the config func GetDefaultRuntimeConfig() (*RuntimeConfig, error) { - cfg, err := getDefault() + cfg, err := GetDefault() if err != nil { return nil, err }