diff --git a/internal/pkg/config/datastructure.go b/internal/pkg/config/datastructure.go index 92ada6ee..4d5cefd1 100644 --- a/internal/pkg/config/datastructure.go +++ b/internal/pkg/config/datastructure.go @@ -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 -} diff --git a/internal/pkg/container/imprt.go b/internal/pkg/container/imprt.go index 620991e7..2f62b438 100644 --- a/internal/pkg/container/imprt.go +++ b/internal/pkg/container/imprt.go @@ -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 { diff --git a/internal/pkg/oci/defaults.go b/internal/pkg/oci/defaults.go index 74bfb859..f7158a6f 100644 --- a/internal/pkg/oci/defaults.go +++ b/internal/pkg/oci/defaults.go @@ -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"