INNER CODE UNIT · Go
updateConfigName
NVIDIA/k8s-device-plugin · cmd/config-manager/main.go:336
func updateConfigName(config string, f *Flags) (string, error) {
// Get a lists of the available config file names
files, err := getConfigFileNameMap(f)
if err != nil {
return "", fmt.Errorf("error getting list of configuration files: %v", err)
}
if len(files) == 0 {
return "", fmt.Errorf("no configuration files available")
}
filenames := make([]string, 0, len(files))
for f := range files {
filenames = append(filenames, f)
}
// If an explicit config was passed in, check to see if it is available.
if config != "" {