Remove config.DataStore()

Comments in the code were already disparaging of config.DataStore(), but
implied that its presence made other code more readable. It was only
used in two places and, imo, how I've refactored it is more explicit and
clear than it was.

Signed-off-by: Jonathon Anderson <janderson@ciq.co>
This commit is contained in:
Jonathon Anderson
2023-04-14 17:39:20 -06:00
parent af6c91ade3
commit a10fdb3808
3 changed files with 2 additions and 9 deletions

View File

@@ -59,10 +59,3 @@ func (s *NfsConf) Unmarshal(unmarshal func(interface{}) error) error {
}
return nil
}
// Waste processor cycles to make code more readable
func DataStore() string {
_ = Get()
return cachedConf.Warewulf.DataStore
}

View File

@@ -15,7 +15,7 @@ import (
)
func ImportDocker(uri string, name string, sCtx *types.SystemContext) error {
OciBlobCacheDir := warewulfconf.DataStore() + "/oci"
OciBlobCacheDir := warewulfconf.Get().Warewulf.DataStore + "/oci"
err := os.MkdirAll(OciBlobCacheDir, 0755)
if err != nil {

View File

@@ -5,7 +5,7 @@ import (
"path/filepath"
)
var defaultCachePath = filepath.Join(warewulfconf.DataStore(), "/container-cache/oci/")
var defaultCachePath = filepath.Join(warewulfconf.Get().Warewulf.DataStore, "/container-cache/oci/")
const (
blobPrefix = "blobs"