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:
@@ -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
|
||||
}
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user