more semantic config upload

This commit is contained in:
Mikaël Cluseau
2025-12-16 14:43:59 +01:00
parent 26d3d0faeb
commit 512177cab0
8 changed files with 69 additions and 18 deletions

View File

@ -2,7 +2,6 @@ package clustersconfig
import (
"fmt"
"io/ioutil"
"os"
"path"
"path/filepath"
@ -178,7 +177,7 @@ type dirStore struct {
// listDir
func (b *dirStore) listDir(prefix string) (subDirs []string, err error) {
entries, err := ioutil.ReadDir(filepath.Join(b.path, prefix))
entries, err := os.ReadDir(filepath.Join(b.path, prefix))
if err != nil {
return
}
@ -226,7 +225,7 @@ func (b *dirStore) List(prefix string) ([]string, error) {
// Load is part of the DataBackend interface
func (b *dirStore) Get(key string) (ba []byte, err error) {
ba, err = ioutil.ReadFile(filepath.Join(b.path, filepath.Join(path.Split(key))+".yaml"))
ba, err = os.ReadFile(filepath.Join(b.path, filepath.Join(path.Split(key))+".yaml"))
if os.IsNotExist(err) {
return nil, nil
}